Skip to content

Commit

Permalink
ci: pre-job on Go workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Dec 28, 2024
1 parent fa0eddc commit 9d958b2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ coverage:
project:
default:
# Target coverage for the whole project https://docs.codecov.com/docs/commit-status#target
target: 50%
target: 75%

# Maximum decrease in coverage https://docs.codecov.com/docs/commit-status#threshold
threshold: 10%
threshold: 5%

patch:
default:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
name: go
on: [push, pull_request]
jobs:
# Adapted from https://github.com/marketplace/actions/skip-duplicate-actions
pre_job:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# https://github.com/marketplace/actions/skip-duplicate-actions#skip-concurrent-workflow-runs
concurrent_skipping: "same_content_newer"
# https://github.com/marketplace/actions/skip-duplicate-actions#cancel_others
# Don't cancel other jobs, they might be pushes to master
cancel_others: false
# https://github.com/marketplace/actions/skip-duplicate-actions#do_not_skip
do_not_skip: '["workflow_dispatch", "schedule", "merge_group", "release"]'
# https://github.com/marketplace/actions/skip-duplicate-actions#paths
paths: '["go.*", "*.go", "cmd/**", "Cargo.*", "pyproject.toml", "python/**", "rust/**"]'

lint:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -15,6 +38,8 @@ jobs:
version: "v1.60"

test:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
strategy:
matrix:
go: [stable]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maturin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# https://github.com/marketplace/actions/skip-duplicate-actions#do_not_skip
do_not_skip: '["workflow_dispatch", "schedule", "merge_group", "release"]'
# https://github.com/marketplace/actions/skip-duplicate-actions#paths
paths: '["go.*", "*.go", "go/**", "Cargo.*", "pyproject.toml", "python/**", "rust/**"]'
paths: '["go.*", "*.go", "cmd/**", "Cargo.*", "pyproject.toml", "python/**", "rust/**"]'

linux:
needs: pre_job
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# https://github.com/marketplace/actions/skip-duplicate-actions#do_not_skip
do_not_skip: '["workflow_dispatch", "schedule", "merge_group", "release"]'
# https://github.com/marketplace/actions/skip-duplicate-actions#paths
paths: '["go.*", "*.go", "go/**", "Cargo.*", "pyproject.toml", "python/**", "rust/**"]'
paths: '["go.*", "*.go", "cmd/**", "Cargo.*", "pyproject.toml", "python/**", "rust/**"]'

test:
needs: pre_job
Expand Down

0 comments on commit 9d958b2

Please sign in to comment.