Skip to content

Commit 4ee4722

Browse files
committed
Archive builds in test-changed and test-changed-auth
1 parent 0f5714b commit 4ee4722

File tree

2 files changed

+104
-12
lines changed

2 files changed

+104
-12
lines changed

.github/workflows/test-changed-auth.yml

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,44 @@ env:
2424
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
2525
CHROMEDRIVER_CDNBINARIESURL: https://storage.googleapis.com/chrome-for-testing-public
2626
CHROME_VALIDATED_VERSION: linux-120.0.6099.71
27+
artifactRetentionDays: 14
2728
# Bump Node memory limit
2829
NODE_OPTIONS: "--max_old_space_size=4096"
2930

3031
jobs:
32+
build:
33+
name: Build the SDK
34+
runs-on: ubuntu-latest
35+
steps:
36+
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
37+
# setting up the repo. This must be done to build and execute Auth properly.
38+
- name: install Chrome stable
39+
run: |
40+
npx @puppeteer/browsers install chrome@stable
41+
- uses: actions/checkout@v3
42+
- name: Set up Node (20)
43+
uses: actions/setup-node@v3
44+
with:
45+
node-version: 22.10.0
46+
- name: Test setup and yarn install
47+
run: |
48+
cp config/ci.config.json config/project.json
49+
yarn
50+
- name: yarn build:changed auth
51+
run: yarn build:changed auth
52+
- name: Archive build
53+
if: ${{ !cancelled() }}
54+
run: |
55+
tar -cf build.tar --exclude=.git .
56+
gzip build.tar
57+
- name: Upload build archive
58+
if: ${{ !cancelled() }}
59+
uses: actions/upload-artifact@v3
60+
with:
61+
name: build.tar.gz
62+
path: build.tar.gz
63+
retention-days: ${{ env.artifactRetentionDays }}
64+
3165
test-chrome:
3266
name: Test Auth on Chrome and Node If Changed
3367
runs-on: ubuntu-latest
@@ -56,6 +90,12 @@ jobs:
5690
with:
5791
# This makes Actions fetch all Git history so run-changed script can diff properly.
5892
fetch-depth: 0
93+
- name: Download build archive
94+
uses: actions/download-artifact@v3
95+
with:
96+
name: build.tar.gz
97+
- name: Unzip build artifact
98+
run: tar xf build.tar.gz
5999
- name: Set up Node (20)
60100
uses: actions/setup-node@v3
61101
with:
@@ -64,8 +104,6 @@ jobs:
64104
run: |
65105
cp config/ci.config.json config/project.json
66106
yarn
67-
- name: build
68-
run: yarn build:changed auth
69107
- name: Run tests on changed packages
70108
run: xvfb-run yarn test:changed auth
71109
test-firefox:
@@ -96,8 +134,12 @@ jobs:
96134
run: |
97135
cp config/ci.config.json config/project.json
98136
yarn
99-
- name: build
100-
run: yarn build:changed auth
137+
- name: Download build archive
138+
uses: actions/download-artifact@v3
139+
with:
140+
name: build.tar.gz
141+
- name: Unzip build artifact
142+
run: tar xf build.tar.gz
101143
- name: Run tests on auth changed packages
102144
run: xvfb-run yarn test:changed auth
103145
env:
@@ -121,8 +163,12 @@ jobs:
121163
cp config/ci.config.json config/project.json
122164
yarn
123165
npx playwright install webkit
124-
- name: build
125-
run: yarn build:changed auth
166+
- name: Download build archive
167+
uses: actions/download-artifact@v3
168+
with:
169+
name: build.tar.gz
170+
- name: Unzip build artifact
171+
run: tar xf build.tar.gz
126172
- name: Run tests on changed packages
127173
run: yarn test:changed auth
128174
env:

.github/workflows/test-changed.yml

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,44 @@ name: Test Modified Packages
1717
on: pull_request
1818

1919
env:
20+
artifactRetentionDays: 14
2021
# Bump Node memory limit
2122
NODE_OPTIONS: "--max_old_space_size=4096"
2223

2324
jobs:
25+
build:
26+
name: Build the SDK
27+
runs-on: ubuntu-latest
28+
steps:
29+
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
30+
# setting up the repo. This must be done to build and execute Auth properly.
31+
- name: install Chrome stable
32+
run: |
33+
npx @puppeteer/browsers install chrome@stable
34+
- uses: actions/checkout@v3
35+
- name: Set up Node (20)
36+
uses: actions/setup-node@v3
37+
with:
38+
node-version: 22.10.0
39+
- name: Test setup and yarn install
40+
run: |
41+
cp config/ci.config.json config/project.json
42+
yarn
43+
- name: yarn build:changed core
44+
run: yarn build:changed core
45+
- name: Archive build
46+
if: ${{ !cancelled() }}
47+
run: |
48+
tar -cf build.tar --exclude=.git .
49+
gzip build.tar
50+
- name: Upload build archive
51+
if: ${{ !cancelled() }}
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: build.tar.gz
55+
path: build.tar.gz
56+
retention-days: ${{ env.artifactRetentionDays }}
57+
2458
test-chrome:
2559
name: Test Packages With Changed Files in Chrome and Node
2660
runs-on: ubuntu-latest
@@ -43,8 +77,12 @@ jobs:
4377
run: |
4478
cp config/ci.config.json config/project.json
4579
yarn
46-
- name: build
47-
run: yarn build:changed core
80+
- name: Download build archive
81+
uses: actions/download-artifact@v3
82+
with:
83+
name: build.tar.gz
84+
- name: Unzip build artifact
85+
run: tar xf build.tar.gz
4886
- name: Run tests on changed packages
4987
run: xvfb-run yarn test:changed core
5088

@@ -72,8 +110,12 @@ jobs:
72110
run: |
73111
cp config/ci.config.json config/project.json
74112
yarn
75-
- name: build
76-
run: yarn build:changed core
113+
- name: Download build archive
114+
uses: actions/download-artifact@v3
115+
with:
116+
name: build.tar.gz
117+
- name: Unzip build artifact
118+
run: tar xf build.tar.gz
77119
- name: Run tests on changed packages
78120
run: xvfb-run yarn test:changed core
79121
env:
@@ -98,8 +140,12 @@ jobs:
98140
cp config/ci.config.json config/project.json
99141
yarn
100142
npx playwright install webkit
101-
- name: build
102-
run: yarn build:changed core
143+
- name: Download build archive
144+
uses: actions/download-artifact@v3
145+
with:
146+
name: build.tar.gz
147+
- name: Unzip build artifact
148+
run: tar xf build.tar.gz
103149
- name: Run tests on changed packages
104150
run: yarn test:changed core
105151
env:

0 commit comments

Comments
 (0)