Skip to content

Commit e65c081

Browse files
committed
feat: shared worflow as job
1 parent 9fe1845 commit e65c081

15 files changed

+66
-90
lines changed

.github/workflows/ami-release-nix-single.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ permissions:
1818
id-token: write
1919

2020
jobs:
21+
checkout:
22+
uses: ./.github/workflows/shared-checkout.yml
23+
2124
build:
25+
needs: checkout
2226
runs-on: arm-runner
2327
timeout-minutes: 150
2428

2529
steps:
26-
- uses: actions/checkout@v4
27-
- uses: ./.github/workflows/shared-checkout.yml
28-
2930
- name: Get current branch SHA
3031
id: get_sha
3132
run: |

.github/workflows/ami-release-nix.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,15 @@ permissions:
1616
id-token: write
1717

1818
jobs:
19+
checkout:
20+
uses: ./.github/workflows/shared-checkout.yml
21+
1922
prepare:
23+
needs: checkout
2024
runs-on: ubuntu-latest
2125
outputs:
2226
postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }}
2327
steps:
24-
# a quirk of GitHub Actions:
25-
# The workflow needs to do actions/checkout@v4 first because:
26-
# It needs to get the workflow files (including our shared-checkout.yml)
27-
# Without this, GitHub Actions can't find the shared workflow to run it
28-
- uses: actions/checkout@v4
29-
- uses: ./.github/workflows/shared-checkout.yml
30-
3128
- uses: DeterminateSystems/nix-installer-action@main
3229

3330
- name: Set PostgreSQL versions
@@ -37,7 +34,7 @@ jobs:
3734
echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT
3835
3936
build:
40-
needs: prepare
37+
needs: [checkout, prepare]
4138
strategy:
4239
matrix:
4340
postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }}
@@ -51,9 +48,6 @@ jobs:
5148
timeout-minutes: 150
5249

5350
steps:
54-
- uses: actions/checkout@v4
55-
- uses: ./.github/workflows/shared-checkout.yml
56-
5751
- uses: DeterminateSystems/nix-installer-action@main
5852

5953
- name: Run checks if triggered manually

.github/workflows/check-shellscripts.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ permissions:
1111
contents: read
1212

1313
jobs:
14+
checkout:
15+
uses: ./.github/workflows/shared-checkout.yml
16+
1417
build:
18+
needs: checkout
1519
runs-on: ubuntu-latest
1620
steps:
17-
- uses: actions/checkout@v4
18-
- uses: ./.github/workflows/shared-checkout.yml
19-
2021
- name: Run ShellCheck
2122
uses: ludeeus/action-shellcheck@master
2223
env:

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ permissions:
77
contents: read
88

99
jobs:
10+
checkout:
11+
uses: ./.github/workflows/shared-checkout.yml
12+
1013
check-release-version:
14+
needs: checkout
1115
timeout-minutes: 5
1216
runs-on: ubuntu-latest
1317
steps:
14-
- uses: actions/checkout@v4
15-
- uses: ./.github/workflows/shared-checkout.yml
16-
1718
- name: Load postgres_release values
1819
id: load_postgres_release
1920
uses: mikefarah/yq@master

.github/workflows/dockerhub-release-matrix.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ permissions:
1515
id-token: write
1616

1717
jobs:
18+
checkout:
19+
uses: ./.github/workflows/shared-checkout.yml
20+
1821
prepare:
22+
needs: checkout
1923
runs-on: ubuntu-latest
2024
outputs:
2125
matrix_config: ${{ steps.set-matrix.outputs.matrix_config }}
2226
steps:
2327
- uses: DeterminateSystems/nix-installer-action@main
24-
- uses: actions/checkout@v4
25-
- uses: ./.github/workflows/shared-checkout.yml
2628
- name: Generate build matrix
2729
id: set-matrix
2830
run: |
@@ -53,8 +55,6 @@ jobs:
5355
outputs:
5456
build_args: ${{ steps.args.outputs.result }}
5557
steps:
56-
- uses: actions/checkout@v4
57-
- uses: ./.github/workflows/shared-checkout.yml
5858
- uses: DeterminateSystems/nix-installer-action@main
5959
- name: Set PostgreSQL version environment variable
6060
run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.version }}" >> $GITHUB_ENV
@@ -78,8 +78,6 @@ jobs:
7878
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }}
7979
timeout-minutes: 180
8080
steps:
81-
- uses: actions/checkout@v4
82-
- uses: ./.github/workflows/shared-checkout.yml
8381
- uses: DeterminateSystems/nix-installer-action@main
8482
- run: docker context create builders
8583
- uses: docker/setup-buildx-action@v3
@@ -134,8 +132,6 @@ jobs:
134132
include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }}
135133
runs-on: ubuntu-latest
136134
steps:
137-
- uses: actions/checkout@v4
138-
- uses: ./.github/workflows/shared-checkout.yml
139135
- uses: DeterminateSystems/nix-installer-action@main
140136
- uses: docker/setup-buildx-action@v3
141137
- uses: docker/login-action@v2
@@ -178,8 +174,6 @@ jobs:
178174
needs: [prepare, merge_manifest]
179175
runs-on: ubuntu-latest
180176
steps:
181-
- uses: actions/checkout@v4
182-
- uses: ./.github/workflows/shared-checkout.yml
183177
- uses: DeterminateSystems/nix-installer-action@main
184178

185179
- name: Debug Input from Prepare

.github/workflows/manual-docker-release.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ permissions:
1212
contents: read
1313

1414
jobs:
15+
checkout:
16+
uses: ./.github/workflows/shared-checkout.yml
17+
1518
prepare:
19+
needs: checkout
1620
runs-on: ubuntu-latest
1721
outputs:
1822
matrix_config: ${{ steps.set-matrix.outputs.matrix_config }}
1923
steps:
2024
- uses: DeterminateSystems/nix-installer-action@main
21-
- uses: actions/checkout@v4
22-
- uses: ./.github/workflows/shared-checkout.yml
2325
- name: Generate build matrix
2426
id: set-matrix
2527
run: |
@@ -50,8 +52,6 @@ jobs:
5052
outputs:
5153
build_args: ${{ steps.args.outputs.result }}
5254
steps:
53-
- uses: actions/checkout@v4
54-
- uses: ./.github/workflows/shared-checkout.yml
5555
- uses: DeterminateSystems/nix-installer-action@main
5656
- name: Set PostgreSQL version environment variable
5757
run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.version }}" >> $GITHUB_ENV
@@ -75,8 +75,6 @@ jobs:
7575
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }}
7676
timeout-minutes: 180
7777
steps:
78-
- uses: actions/checkout@v4
79-
- uses: ./.github/workflows/shared-checkout.yml
8078
- uses: DeterminateSystems/nix-installer-action@main
8179
- run: docker context create builders
8280
- uses: docker/setup-buildx-action@v3
@@ -143,8 +141,6 @@ jobs:
143141
include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }}
144142
runs-on: ubuntu-latest
145143
steps:
146-
- uses: actions/checkout@v4
147-
- uses: ./.github/workflows/shared-checkout.yml
148144
- uses: DeterminateSystems/nix-installer-action@main
149145
- uses: docker/setup-buildx-action@v3
150146
- uses: docker/login-action@v2
@@ -187,8 +183,6 @@ jobs:
187183
needs: [prepare, merge_manifest]
188184
runs-on: ubuntu-latest
189185
steps:
190-
- uses: actions/checkout@v4
191-
- uses: ./.github/workflows/shared-checkout.yml
192186
- uses: DeterminateSystems/nix-installer-action@main
193187

194188
- name: Debug Input from Prepare

.github/workflows/mirror-postgrest.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ permissions:
1212
contents: read
1313

1414
jobs:
15+
checkout:
16+
uses: ./.github/workflows/shared-checkout.yml
17+
1518
version:
19+
needs: checkout
1620
runs-on: ubuntu-latest
1721
outputs:
1822
postgrest_release: ${{ steps.args.outputs.result }}
1923
steps:
20-
- uses: actions/checkout@v4
21-
- uses: ./.github/workflows/shared-checkout.yml
22-
2324
- id: args
2425
uses: mikefarah/yq@master
2526
with:

.github/workflows/nix-build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ permissions:
1313
id-token: write
1414

1515
jobs:
16+
checkout:
17+
uses: ./.github/workflows/shared-checkout.yml
18+
1619
build-run-image:
20+
needs: checkout
1721
strategy:
1822
fail-fast: false
1923
matrix:
@@ -27,9 +31,6 @@ jobs:
2731
runs-on: ${{ matrix.runner }}
2832
timeout-minutes: 180
2933
steps:
30-
- uses: actions/checkout@v4
31-
- uses: ./.github/workflows/shared-checkout.yml
32-
3334
- name: aws-creds
3435
uses: aws-actions/configure-aws-credentials@v4
3536
with:

.github/workflows/publish-migrations-prod.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ on:
44
workflow_dispatch:
55

66
jobs:
7+
checkout:
8+
uses: ./.github/workflows/shared-checkout.yml
9+
710
build:
11+
needs: checkout
812
runs-on: [self-hosted, linux]
913
timeout-minutes: 15
1014
permissions:
@@ -21,9 +25,6 @@ jobs:
2125
env:
2226
GITHUB_REF: ${{ github.ref }}
2327

24-
- uses: actions/checkout@v4
25-
- uses: ./.github/workflows/shared-checkout.yml
26-
2728
- name: Merging migration files
2829
run: cat $(ls -1) > ../migration-output.sql
2930
working-directory: ${{ github.workspace }}/migrations/db/migrations

.github/workflows/publish-migrations-staging.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ on:
77
workflow_dispatch:
88

99
jobs:
10+
checkout:
11+
uses: ./.github/workflows/shared-checkout.yml
12+
1013
build:
14+
needs: checkout
1115
runs-on: [self-hosted, linux]
1216
timeout-minutes: 15
1317
permissions:
1418
id-token: write
1519
contents: read
1620

1721
steps:
18-
- uses: actions/checkout@v4
19-
- uses: ./.github/workflows/shared-checkout.yml
20-
2122
- name: Merging migration files
2223
run: cat $(ls -1) > ../migration-output.sql
2324
working-directory: ${{ github.workspace }}/migrations/db/migrations

0 commit comments

Comments
 (0)