Skip to content

Commit

Permalink
chore(ci): cleanup CI flows (#595)
Browse files Browse the repository at this point in the history
* chore: cleanup CI flows

- remove codeql
- pin 3rd-party action versions

Signed-off-by: Pavel Boldyrev <[email protected]>

* run linter only if go files changed

Signed-off-by: Pavel Boldyrev <[email protected]>

* run build/test only if go files changed

Signed-off-by: Pavel Boldyrev <[email protected]>

---------

Signed-off-by: Pavel Boldyrev <[email protected]>
  • Loading branch information
bpg authored Oct 1, 2023
1 parent 5e24a75 commit bd09fd3
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 90 deletions.
78 changes: 0 additions & 78 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

15 changes: 14 additions & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,30 @@ on:
permissions:
contents: read
pull-requests: read

jobs:

golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1

- uses: dorny/[email protected]
id: filter
with:
filters: |
go:
- '**/*.go'
- uses: actions/setup-go@v4
if: steps.filter.outputs.go == 'true'
with:
go-version-file: 'go.mod'

- name: golangci-lint
if: steps.filter.outputs.go == 'true'
run: |
go run -modfile=tools/go.mod github.com/golangci/golangci-lint/cmd/golangci-lint run -v --timeout 5m
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
uses: crazy-max/ghaction-import-gpg@82a020f1f7f605c65dd2449b392a52c3fcfef7ef #v6.0.0
with:
git_user_signingkey: true
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}

- name: Run GoReleaser
uses: goreleaser/[email protected]
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 #v5.0.0
with:
version: latest
args: release --rm-dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
- uses: google-github-actions/release-please-action@4c5670f886fe259db4d11222f7dff41c1382304d #v3.7.12
with:
token: ${{ secrets.BOT_TOKEN }}
release-type: go
Expand Down
35 changes: 27 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
name: Tests
on:
pull_request:
paths-ignore:
- 'README.md'
pull_request: {}
push:
branches:
- main
- "release/**"
paths-ignore:
- 'README.md'
jobs:
# ensure the code builds...

build:
name: Build
runs-on: ubuntu-latest
Expand All @@ -19,16 +15,28 @@ jobs:

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: dorny/[email protected]
id: filter
with:
filters: |
go:
- '**/*.go'
- name: Set up Go
if: steps.filter.outputs.go == 'true'
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- name: Get dependencies
if: steps.filter.outputs.go == 'true'
run: go mod download

- name: Build
if: steps.filter.outputs.go == 'true'
run: go vet . && go build -v .

test:
Expand All @@ -37,18 +45,29 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: dorny/[email protected]
id: filter
with:
filters: |
go:
- '**/*.go'
- name: Set up Go
if: steps.filter.outputs.go == 'true'
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- name: Get dependencies
if: steps.filter.outputs.go == 'true'
run: go mod download

- name: Unit tests
if: steps.filter.outputs.go == 'true'
timeout-minutes: 10
run: go test -v -cover ./...

Expand Down

0 comments on commit bd09fd3

Please sign in to comment.