Skip to content

Commit

Permalink
feat: update all workflow (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
DblK authored May 5, 2023
1 parent 5d44360 commit 6011d46
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 29 deletions.
81 changes: 63 additions & 18 deletions .github/workflows/ginkgo.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,74 @@
name: test
name: ginkgo

on: [push, pull_request]
on:
push:
tags-ignore:
- '**'
branches:
- master
pull_request:

jobs:
build:
mod:
runs-on: ubuntu-latest
name: Check modules
steps:

- uses: actions/setup-go@v3
with:
go-version: 1.17

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
-
id: vars
run: |
echo ::set-output name=go_version::$(cat go.mod | head -3 | tail -1 | cut -d ' ' -f 2)
echo "Using Go version ${{ steps.vars.outputs.go_version }}"
- name: Set up Go
uses: actions/setup-go@v2
fetch-depth: 2

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
go-version: ${{ steps.vars.outputs.go_version }}
files: |
go.*
**/*.go
- name: Verify Go Modules Setup
if: steps.changed-files.outputs.any_changed == 'true'
run: go mod verify

- run: go mod tidy && git diff --exit-code go.mod go.sum
if: steps.changed-files.outputs.any_changed == 'true'

build:
runs-on: ubuntu-latest
steps:

- uses: actions/setup-go@v3
with:
go-version: '1.19'

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
files: |
go.*
**/*.go
- run: go vet ./...

- name: Install ginkgo
run: |
go get github.com/onsi/ginkgo/v2/ginkgo
go get github.com/onsi/gomega/...
if: steps.changed-files.outputs.any_changed == 'true'
run: go get github.com/onsi/ginkgo/v2/ginkgo

- name: Print out Ginkgo version
run: ginkgo version
- run: ginkgo -r --randomize-all --randomize-suites --race --trace -cover
if: steps.changed-files.outputs.any_changed == 'true'
run: go run github.com/onsi/ginkgo/v2/ginkgo version

- name: Launch tests
if: steps.changed-files.outputs.any_changed == 'true'
run: go run github.com/onsi/ginkgo/v2/ginkgo -r --randomize-all --randomize-suites --race --trace -cover
26 changes: 23 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
pull_request:

permissions:
contents: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
go-version: 1.17
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
files: |
go.*
**/*.go
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
if: steps.changed-files.outputs.any_changed == 'true'
uses: golangci/[email protected]
with:
version: v1.52.2
version: v1.52.2
10 changes: 2 additions & 8 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
-
id: vars
run: |
echo ::set-output name=go_version::$(cat go.mod | head -3 | tail -1 | cut -d ' ' -f 2)
echo "Using Go version ${{ steps.vars.outputs.go_version }}"
- name: Set up Go
uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.vars.outputs.go_version }}
go-version: 1.17
- name: Compile the source
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"noctx",
"nolintlint",
"nxdumptool",
"onsi",
"prealloc",
"renameio",
"robustio",
Expand Down

0 comments on commit 6011d46

Please sign in to comment.