Skip to content

Commit

Permalink
Deduplicate deduplication logic in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
garryod committed Jan 8, 2025
1 parent 6b3933f commit 9533590
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 29 deletions.
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
{
"features": {
"ghcr.io/devcontainers-extra/features/fzf:1.0.14": {
"version": "1.0.14",
"resolved": "ghcr.io/devcontainers-extra/features/fzf@sha256:0267f658774be0ac66ac0f78ffd0673486513443ffc65cd92216b69af0929398",
"integrity": "sha256:0267f658774be0ac66ac0f78ffd0673486513443ffc65cd92216b69af0929398"
},
"ghcr.io/devcontainers/features/common-utils": {
"version": "2.5.2",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:5b1c376d30719a4dead8fb2f272ee496cfb506f2f92b7acf9e1c24cb5399ba7d",
"integrity": "sha256:5b1c376d30719a4dead8fb2f272ee496cfb506f2f92b7acf9e1c24cb5399ba7d"
},
"ghcr.io/devcontainers/features/common-utils:2.2.0": {
"version": "2.2.0",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:8d0f43896efd556a53e5881a726417e50fcdda874fd535919a8f8feeac42383e",
"integrity": "sha256:8d0f43896efd556a53e5881a726417e50fcdda874fd535919a8f8feeac42383e"
},
"ghcr.io/devcontainers/features/git": {
"version": "1.3.2",
"resolved": "ghcr.io/devcontainers/features/git@sha256:63c96e8ac33f5630300d8883e2ec3123278de70d318589af596ea1954846014d",
"integrity": "sha256:63c96e8ac33f5630300d8883e2ec3123278de70d318589af596ea1954846014d"
},
"ghcr.io/duduribeiro/devcontainer-features/neovim:1.0.1": {
"version": "1.0.1",
"resolved": "ghcr.io/duduribeiro/devcontainer-features/neovim@sha256:bc0189d90386de0f8a72393de2bb1402bdff8072a608e1aa362761b2a0da3fd6",
"integrity": "sha256:bc0189d90386de0f8a72393de2bb1402bdff8072a608e1aa362761b2a0da3fd6",
"dependsOn": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/git"
]
},
"ghcr.io/GeorgOfenbeck/features/lazygit-linuxbinary:1.0.0": {
"version": "1.0.0",
"resolved": "ghcr.io/georgofenbeck/features/lazygit-linuxbinary@sha256:5f95752dbaf9a2798039e7cfd09887dca886654899de5c3c257d870c74230523",
"integrity": "sha256:5f95752dbaf9a2798039e7cfd09887dca886654899de5c3c257d870c74230523"
}
}
}
49 changes: 20 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ on:
pull_request:

jobs:
devcontainer:
deduplicate:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
steps: []

devcontainer:
needs: deduplicate
uses: ./.github/workflows/_devcontainer.yaml

bundler_lint:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: deduplicate
uses: ./.github/workflows/_bundler_lint.yaml

bundler_test:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: deduplicate
uses: ./.github/workflows/_bundler_test.yaml

bundler_container:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs:
- deduplicate
- bundler_lint
- bundler_test
permissions:
Expand All @@ -32,24 +33,20 @@ jobs:
uses: ./.github/workflows/_bundler_container.yaml

bundler_docs:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: deduplicate
uses: ./.github/workflows/_bundler_docs.yaml

policy_lint:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: deduplicate
uses: ./.github/workflows/_policy_lint.yaml

policy_test:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: deduplicate
uses: ./.github/workflows/_policy_test.yaml

policy_container:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs:
- deduplicate
- policy_lint
- policy_test
permissions:
Expand All @@ -58,48 +55,42 @@ jobs:
uses: ./.github/workflows/_policy_container.yaml

helm_chart_lint:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: deduplicate
uses: ./.github/workflows/_helm_chart_lint.yaml

helm_chart_publish:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: helm_chart_lint
needs:
- deduplicate
- helm_chart_lint
permissions:
contents: read
packages: write
uses: ./.github/workflows/_helm_chart_publish.yaml

docs_lint:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: deduplicate
uses: ./.github/workflows/_docs_lint.yaml

docs_build:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs: deduplicate
uses: ./.github/workflows/_docs_build.yaml

techdocs_publish:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs:
- deduplicate
- docs_lint
- docs_build
uses: ./.github/workflows/_techdocs_publish.yaml

pages_build:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs:
- deduplicate
- bundler_docs
- docs_lint
- docs_build
uses: ./.github/workflows/_pages_build.yaml

pages_publish:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: pages_build
permissions:
Expand Down

0 comments on commit 9533590

Please sign in to comment.