Skip to content

Commit e1c5799

Browse files
committed
chore: fix caching in workflows
1 parent b5c182e commit e1c5799

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

.github/workflows/test-all-versions.pr.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ jobs:
2626
OUTPUT=`node scripts/pr-labels-to-npm-workspace-args.mjs "$PR_LABELS"`
2727
echo "args=$OUTPUT" >> $GITHUB_OUTPUT
2828
29-
# TODO: uncomment once the build cache issue is solved
30-
# tav:
31-
# uses: ./.github/workflows/test-all-versions.yml
32-
# needs: parse-labels
33-
# with:
34-
# npm-workspace-args: ${{ needs.parse-labels.outputs.args }}
35-
# if: ${{ needs.parse-labels.outputs.args != '' }}
29+
tav:
30+
uses: ./.github/workflows/test-all-versions.yml
31+
needs: parse-labels
32+
with:
33+
npm-workspace-args: ${{ needs.parse-labels.outputs.args }}
34+
if: ${{ needs.parse-labels.outputs.args != '' }}

.github/workflows/test-all-versions.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ jobs:
3131
node-version: 18
3232
- name: Install
3333
run: npm ci
34-
- name: Build
35-
run: npm run compile
36-
- name: Snapshot build state
37-
run: tar -czvf nx-snapshot.tar.gz ./.nx
34+
- name: Build and pack artifacts
35+
run: npm run compile && tar -czvf nx-pack.tar.gz .nx
3836
- name: Upload Build Artifacts
3937
uses: actions/upload-artifact@v4
4038
with:
4139
name: tav-build-cache-${{ github.run_number }}
42-
path: nx-snapshot.tar.gz
40+
path: nx-pack.tar.gz
4341
retention-days: 1
4442

4543
tav:
@@ -171,8 +169,9 @@ jobs:
171169
uses: actions/download-artifact@v4
172170
with:
173171
name: tav-build-cache-${{ github.run_number }}
174-
path: .nx
175-
- name: Build
176-
run: npm run compile
172+
# Note: `Install` step created a `.nx` folder. We should replace it
173+
# with the packed one from `build-and-cache` job
174+
- name: Unpack artifacts and Build
175+
run: rm -rf .nx && tar -xvf nx-pack.tar.gz && npm run compile
177176
- name: Run test-all-versions
178177
run: npm run --if-present --workspaces test-all-versions ${{ inputs.npm-workspace-args }}

.github/workflows/unit-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ jobs:
177177
- name: Set MySQL variables
178178
run: mysql --user=root --password=${MYSQL_ROOT_PASSWORD} --host=${MYSQL_HOST} --port=${MYSQL_PORT} -e "SET GLOBAL log_output='TABLE'; SET GLOBAL general_log = 1;" mysql
179179
- name: Install
180-
run: npm ci && rm -rf .nx
180+
run: npm ci
181181
- name: Download Build Artifacts
182182
uses: actions/download-artifact@v4
183183
with:
184184
name: tests-build-cache-${{ github.run_number }}
185-
- name: Check dowloaded artifacts
186-
run: ls -la
185+
# Note: `Install` step created a `.nx` folder. We should replace it
186+
# with the packed one from `build-and-cache` job
187187
- name: Unpack artifacts and Build
188188
run: rm -rf .nx && tar -xvf nx-pack.tar.gz && npm run compile
189189
- name: Unit tests (Full)

0 commit comments

Comments
 (0)