-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): Skip GCP CI jobs on PRs from external contributors, let merg…
…ify test them after approval (#7956) * Skip external branches in ci-unit-tests-docker.yml * Patch external repositories in ci-unit-tests-docker.patch.yml * Revert ci-unit-tests-docker.patch.yml * Add a separate external PR patch in ci-unit-tests-docker.patch-external.yml * Document ci-unit-tests-docker.patch.yml * Document ci-unit-tests-docker.yml * Skip dependabot config validation for external PRs * Trivial Rust code modification to make Rust workflows run * Use correct method for checking source branch refs * Fix the check condition * Simplify job structure * Use correct skip condition * Make the start docs visible so we can link to them * Skip integration tests on external PRs * Allow external PRs to pass CD Docker tests * Allow external PRs to pass Docs build and deploy
- Loading branch information
Showing
15 changed files
with
309 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Workflow patches for skipping Google Cloud CD deployments on PRs from external repositories. | ||
name: Deploy Nodes to GCP | ||
|
||
# Run on PRs from external repositories, let them pass, and then Mergify will check them. | ||
# GitHub doesn't support filtering workflows by source branch names, so we have to do it for each | ||
# job. | ||
on: | ||
pull_request: | ||
|
||
# IMPORTANT | ||
# | ||
# These job names must be kept in sync with the `.patch.yml` and `.yml` files. | ||
jobs: | ||
# We don't patch the testnet job, because testnet isn't required to merge (it's too unstable) | ||
build: | ||
name: Build CD Docker / Build images | ||
# Only run on PRs from external repositories, skipping ZF branches and tags. | ||
if: ${{ !contains(github.head_ref || github.ref, 'refs/heads/') && !contains(github.head_ref || github.ref, 'refs/tags/') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-configuration-file: | ||
name: Test CD default Docker config file / Test default-conf in Docker | ||
# This dependency allows all these jobs to depend on a single condition, making it easier to | ||
# change. | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-zebra-conf-path: | ||
name: Test CD custom Docker config file / Test custom-conf in Docker | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
.github/workflows/ci-integration-tests-gcp.patch-external.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Workflow patches for skipping Google Cloud unit test CI on PRs from external repositories. | ||
name: Integration Tests on GCP | ||
|
||
# Run on PRs from external repositories, let them pass, and then Mergify will check them. | ||
# GitHub doesn't support filtering workflows by source branch names, so we have to do it for each | ||
# job. | ||
on: | ||
pull_request: | ||
|
||
# IMPORTANT | ||
# | ||
# These job names must be kept in sync with the `.patch.yml` and `.yml` files. | ||
jobs: | ||
# We don't patch the testnet job, because testnet isn't required to merge (it's too unstable) | ||
get-available-disks: | ||
name: Check if cached state disks exist for Mainnet / Check if cached state disks exist | ||
# Only run on PRs from external repositories. | ||
# (github.ref is always a local branch, so this check will skip non-PRs as well.) | ||
if: ${{ !contains(github.head_ref || github.ref, 'refs/heads/') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
build: | ||
name: Build CI Docker / Build images | ||
# This dependency allows all these jobs to depend on a single condition, making it easier to | ||
# change. | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-stateful-sync: | ||
name: Zebra checkpoint update / Run sync-past-checkpoint test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-update-sync: | ||
name: Zebra tip update / Run update-to-tip test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
checkpoints-mainnet: | ||
name: Generate checkpoints mainnet / Run checkpoints-mainnet test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
lightwalletd-rpc-test: | ||
name: Zebra tip JSON-RPC / Run fully-synced-rpc test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
lightwalletd-transactions-test: | ||
name: lightwalletd tip send / Run lwd-send-transactions test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
get-block-template-test: | ||
name: get block template / Run get-block-template test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
submit-block-test: | ||
name: submit block / Run submit-block test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
lightwalletd-full-sync: | ||
name: lightwalletd tip / Run lwd-full-sync test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
lightwalletd-update-sync: | ||
name: lightwalletd tip update / Run lwd-update-sync test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
lightwalletd-grpc-test: | ||
name: lightwalletd GRPC tests / Run lwd-grpc-wallet test | ||
needs: get-available-disks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,7 +148,11 @@ jobs: | |
with: | ||
level: warning | ||
fail_on_error: false | ||
# This gives an error when run on PRs from external repositories, so we skip it. | ||
- name: validate-dependabot | ||
# If this is a PR, check that the PR source is from a local branch. | ||
# (github.ref is always a local branch, so this check always passes for non-PRs.) | ||
if: ${{ contains(github.head_ref || github.ref, 'refs/heads/') }} | ||
uses: marocchino/[email protected] | ||
|
||
codespell: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Workflow patches for skipping Google Cloud unit test CI on PRs from external repositories. | ||
name: Docker Unit Tests | ||
|
||
# Run on PRs from external repositories, let them pass, and then Mergify will check them. | ||
# GitHub doesn't support filtering workflows by source branch names, so we have to do it for each | ||
# job. | ||
on: | ||
pull_request: | ||
|
||
# IMPORTANT | ||
# | ||
# These job names must be kept in sync with the `.patch.yml` and `.yml` files. | ||
jobs: | ||
build: | ||
name: Build CI Docker / Build images | ||
# Only run on PRs from external repositories. | ||
# (github.ref is always a local branch, so this check will skip non-PRs as well.) | ||
if: ${{ !contains(github.head_ref || github.ref, 'refs/heads/') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-all: | ||
name: Test all | ||
# This dependency allows all these jobs to depend on a single condition, making it easier to | ||
# change. | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-fake-activation-heights: | ||
name: Test with fake activation heights | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-empty-sync: | ||
name: Test checkpoint sync from empty state | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-lightwalletd-integration: | ||
name: Test integration with lightwalletd | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-configuration-file: | ||
name: Test CI default Docker config file / Test default-conf in Docker | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' | ||
|
||
test-zebra-conf-path: | ||
name: Test CI custom Docker config file / Test custom-conf in Docker | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No build required"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.