Skip to content

Commit a5eaf32

Browse files
authored
chore: fix gh artifact poisoning (#121)
* chore: fix artifact poisoning * chore: update cache key and build ids * fix: handle gh run download extracting artifacts directly The gh run download command extracts artifact contents directly to the specified directory, not as a zip file. Updated the download-archive action to: 1. Check if artifact contents were extracted directly (look for packages/ or fixtures/ dirs) 2. Set extracted=true output when contents are already extracted 3. Skip zip extraction step when contents are already extracted 4. Handle both cache (zip) and artifact download (extracted) paths consistently 5. Copy dist/, dist-js/, and target/ directories to workspace from either source This fixes the intermittent failures where cache miss would cause the artifact fallback to also fail because it couldn't find the expected zip file. * refactor: rework download-archive * chore: unzip where necessary * chore: revert * refactor: rework download-archive * fix: built artifact cache b0rkage * chore: add debug, fix * chore: add debug * fix: normalize paths in copy_directory for Windows mixed-slash paths
1 parent 1aaefd9 commit a5eaf32

File tree

10 files changed

+266
-229
lines changed

10 files changed

+266
-229
lines changed

.github/workflows/_ci-build-tauri-e2e-app.reusable.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ jobs:
146146
- name: 📦 Download Package Build Artifacts
147147
uses: ./.github/workflows/actions/download-archive
148148
with:
149-
name: wdio-electron-service
150-
path: wdio-electron-service-build
149+
name: wdio-desktop-mobile
150+
path: wdio-desktop-mobile-build
151151
filename: artifact.zip
152-
cache_key_prefix: wdio-electron-build
153-
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-electron-build', 'wdio-electron-service', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
152+
cache_key_prefix: wdio-desktop-build
153+
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-desktop-build', 'wdio-desktop-mobile', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
154154

155155
# Display build information if available
156156
- name: 📊 Show Build Information

.github/workflows/_ci-build.reusable.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ jobs:
7979
if: ${{ runner.os == 'Linux' }}
8080
uses: ./.github/workflows/actions/upload-archive
8181
with:
82-
name: wdio-electron-service
83-
output: wdio-electron-service-build/artifact.zip
82+
name: wdio-desktop-mobile
83+
output: wdio-desktop-mobile-build/artifact.zip
8484
paths: packages/*/dist packages/*/dist-js
85-
cache_key_prefix: wdio-electron-build
85+
cache_key_prefix: wdio-desktop-build
8686
retention_days: '90'

.github/workflows/_ci-e2e-tauri.reusable.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ jobs:
139139
- name: 📦 Download Package Build Artifacts
140140
uses: ./.github/workflows/actions/download-archive
141141
with:
142-
name: wdio-electron-service
143-
path: wdio-electron-service-build
142+
name: wdio-desktop-mobile
143+
path: wdio-desktop-mobile-build
144144
filename: artifact.zip
145-
cache_key_prefix: wdio-electron-build
146-
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-electron-build', 'wdio-electron-service', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
145+
cache_key_prefix: wdio-desktop-build
146+
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-desktop-build', 'wdio-desktop-mobile', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
147147

148148
# Download the pre-built Tauri E2E app binary from the OS-specific build job
149149
# This is much faster than rebuilding Tauri apps for each test type

.github/workflows/_ci-e2e.reusable.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ jobs:
7171
- name: 📦 Download Build Artifacts
7272
uses: ./.github/workflows/actions/download-archive
7373
with:
74-
name: wdio-electron-service
75-
path: wdio-electron-service-build
74+
name: wdio-desktop-mobile
75+
path: wdio-desktop-mobile-build
7676
filename: artifact.zip
77-
cache_key_prefix: wdio-electron-build
78-
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-electron-build', 'wdio-electron-service', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
77+
cache_key_prefix: wdio-desktop-build
78+
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-desktop-build', 'wdio-desktop-mobile', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
7979

8080
# Display build information if available
8181
- name: 📊 Show Build Information

.github/workflows/_ci-lint.reusable.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ jobs:
5454
- name: 📦 Download Build Artifacts
5555
uses: ./.github/workflows/actions/download-archive
5656
with:
57-
name: wdio-electron-service
58-
path: wdio-electron-service-build
57+
name: wdio-desktop-mobile
58+
path: wdio-desktop-mobile-build
5959
filename: artifact.zip
60-
cache_key_prefix: wdio-electron-build
61-
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-electron-build', 'wdio-electron-service', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
60+
cache_key_prefix: wdio-desktop-build
61+
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-desktop-build', 'wdio-desktop-mobile', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
6262

6363
# Run Linting checks
6464
- name: 🔍 Run Linting

.github/workflows/_ci-package.reusable.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ jobs:
9696
- name: 📦 Download Build Artifacts
9797
uses: ./.github/workflows/actions/download-archive
9898
with:
99-
name: wdio-electron-service
100-
path: wdio-electron-service-build
99+
name: wdio-desktop-mobile
100+
path: wdio-desktop-mobile-build
101101
filename: artifact.zip
102-
cache_key_prefix: wdio-electron-build
103-
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-electron-build', 'wdio-electron-service', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
102+
cache_key_prefix: wdio-desktop-build
103+
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-desktop-build', 'wdio-desktop-mobile', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
104104

105105
# Download app binaries if testing services that require pre-built apps
106106
# The download-archive action extracts to workspace root, preserving directory structure

.github/workflows/_ci-unit.reusable.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ jobs:
5252
- name: 📦 Download Build Artifacts
5353
uses: ./.github/workflows/actions/download-archive
5454
with:
55-
name: wdio-electron-service
56-
path: wdio-electron-service-build
55+
name: wdio-desktop-mobile
56+
path: wdio-desktop-mobile-build
5757
filename: artifact.zip
58-
cache_key_prefix: wdio-electron-build
59-
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-electron-build', 'wdio-electron-service', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
58+
cache_key_prefix: wdio-desktop-build
59+
exact_cache_key: ${{ inputs.cache_key || github.run_id && format('{0}-{1}-{2}-{3}{4}', 'Linux', 'wdio-desktop-build', 'wdio-desktop-mobile', github.run_id, github.run_attempt > 1 && format('-rerun{0}', github.run_attempt) || '') || '' }}
6060

6161
# Verify the extracted dist directories exist
6262
- name: 🔍 Verify Extracted Files

0 commit comments

Comments
 (0)