A local-first personal finance app
Refactor CI workflows to use shared setup job (#7551)
Matiss Janis Aboltins3373154b405d
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 15e2d5d163..a1adddafc2 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -19,10 +19,26 @@ concurrency:cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}jobs:+ setup:+ runs-on: ubuntu-latest+ permissions:+ contents: read+ steps:+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false+ - name: Set up environment+ uses: ./.github/actions/setup+ with:+ download-translations: 'false'+api:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:@@ -45,9 +61,12 @@ jobs:path: api-stats.jsoncrdt:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:@@ -70,9 +89,12 @@ jobs:path: crdt-stats.jsonweb:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setup- name: Build Web@@ -89,9 +111,12 @@ jobs:path: packages/desktop-client/build-statscli:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:@@ -114,9 +139,12 @@ jobs:path: cli-stats.jsonserver:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:diff --git a/.github/workflows/check.yml b/.github/workflows/check.ymlindex 139dc28a0d..3d3ea32799 100644--- a/.github/workflows/check.yml+++ b/.github/workflows/check.yml@@ -12,10 +12,25 @@ concurrency:cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}jobs:+ setup:+ runs-on: ubuntu-latest+ permissions:+ contents: read+ steps:+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false+ - name: Set up environment+ uses: ./.github/actions/setup+ with:+ download-translations: 'false'constraints:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:@@ -23,9 +38,12 @@ jobs:- name: Check dependency version consistencyrun: yarn constraintslint:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:@@ -33,9 +51,12 @@ jobs:- name: Lintrun: yarn linttypecheck:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:@@ -43,9 +64,12 @@ jobs:- name: Typecheckrun: yarn typecheckvalidate-cli:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:@@ -55,9 +79,12 @@ jobs:- name: Check that the built CLI worksrun: node packages/sync-server/build/bin/actual-server.js --versiontest:+ needs: setupruns-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:@@ -75,10 +102,13 @@ jobs:- uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2migrations:+ needs: setupif: github.event_name == 'pull_request'runs-on: ubuntu-lateststeps:- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2+ with:+ persist-credentials: false- name: Set up environmentuses: ./.github/actions/setupwith:diff --git a/upcoming-release-notes/7551.md b/upcoming-release-notes/7551.mdnew file mode 100644index 0000000000..f175b29399--- /dev/null+++ b/upcoming-release-notes/7551.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [actualbudget]+---++Share the CI dependency install across `check.yml` and `build.yml` jobs via a single upstream `setup` job to cut redundant `yarn install` runs on cache-cold workflow runs.