Skip to content

Commit

Permalink
Add path filters
Browse files Browse the repository at this point in the history
Signed-off-by: Russell Troxel <[email protected]>
  • Loading branch information
rtrox committed Jan 20, 2024
1 parent 2cfc6c5 commit e84d58c
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ on:


jobs:
check-changed-files:
runs-on: ubuntu-latest
outputs:
go-files: ${{ steps.changes.outputs.go-files }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
go-files:
- '**.go'
- 'go.mod'
- 'go.sum'
linter-configs:
- '.github/lint/**'
pre-commit-check:
runs-on: ubuntu-latest
steps:
Expand All @@ -15,6 +32,7 @@ jobs:
extra_args: --config .github/lint/precommit-ci.yaml

golang-basic-lint:
# Super Cheap, Always Run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -33,25 +51,36 @@ jobs:
git diff --exit-code
golangci-lint:
if: jobs.check-changed-files.outputs.go-files == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
if: steps.changes.outputs.go-files == 'true'
with:
go-version: ">=1.21.4"
- uses: golangci/golangci-lint-action@v3
- uses: golangci/golangci-lint-action@v3'
if: steps.changes.outputs.go-files == 'true'
with:
version: v1.54
args: --timeout 5m --config .github/lint/golangci.yaml

go-tests:
if: jobs.check-changed-files.outputs.go-files == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
go-files:
- '**.go'
- 'go.mod'
- 'go.sum'
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand Down

0 comments on commit e84d58c

Please sign in to comment.