Skip to content

Commit 95196dc

Browse files
committed
ci: wait for the nix workflow to succeed before running the test and testinfra-ami-build workflow
1 parent c630680 commit 95196dc

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Test Database
22
on:
3-
push:
4-
branches:
5-
- develop
6-
pull_request:
3+
# Trigger this workflow when the "Nix CI" workflow completes
4+
workflow_run:
5+
workflows: ["Nix CI"]
6+
types:
7+
- completed
78
workflow_dispatch:
89

910
permissions:
@@ -12,6 +13,7 @@ permissions:
1213

1314
jobs:
1415
prepare:
16+
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
1517
runs-on: large-linux-x86
1618
outputs:
1719
postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }}
@@ -29,6 +31,7 @@ jobs:
2931
VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c "split(\"\n\")[:-1]")
3032
echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT
3133
build:
34+
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
3235
needs: prepare
3336
strategy:
3437
matrix:

.github/workflows/testinfra-ami-build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: Testinfra Integration Tests Nix
22

33
on:
4-
pull_request:
4+
# Trigger this workflow when the "Nix CI" workflow completes
5+
workflow_run:
6+
workflows: ["Nix CI"]
7+
types:
8+
- completed
59
workflow_dispatch:
610

711
permissions:
@@ -10,6 +14,7 @@ permissions:
1014

1115
jobs:
1216
prepare:
17+
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
1318
runs-on: large-linux-x86
1419
outputs:
1520
postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }}
@@ -26,6 +31,7 @@ jobs:
2631
echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT
2732
2833
test-ami-nix:
34+
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
2935
needs: prepare
3036
strategy:
3137
fail-fast: false

0 commit comments

Comments
 (0)