Skip to content

Commit fd91110

Browse files
authored
ci(enhance): app GitHub workflow reusable actions (#18417)
Instead of repeated code, use the shared actions. This includes caching simplification as we no longer need the anything custom. The GitHub UI allows cache deletions now. These steps have been running for months in `.github/workflows/pd-test-build-deploy.yaml`
1 parent 2c6c012 commit fd91110

File tree

1 file changed

+6
-132
lines changed

1 file changed

+6
-132
lines changed

.github/workflows/app-test-build-deploy.yaml

Lines changed: 6 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ on:
3636
- '*.json'
3737
- 'yarn.lock'
3838
- 'scripts/**'
39-
workflow_dispatch:
39+
workflow_dispatch: {}
4040

4141
concurrency:
4242
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.ref_name != 'edge' || github.run_id}}-${{ github.ref_type != 'tag' || github.run_id }}
4343
cancel-in-progress: true
4444

4545
env:
46-
CI: true
46+
CI: "true"
4747
_APP_DEPLOY_BUCKET_ROBOTSTACK: builds.opentrons.com
4848
_APP_DEPLOY_FOLDER_ROBOTSTACK: app
4949
_APP_DEPLOY_BUCKET_OT3: ot3-development.builds.opentrons.com
@@ -57,33 +57,7 @@ jobs:
5757
timeout-minutes: 60
5858
steps:
5959
- uses: 'actions/checkout@v4'
60-
- uses: 'actions/setup-node@v4'
61-
with:
62-
node-version: '22.11.0'
63-
- name: 'install udev'
64-
run: |
65-
# WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
66-
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
67-
sudo apt-get update && sudo apt-get install libudev-dev
68-
- name: 'set complex environment variables'
69-
id: 'set-vars'
70-
uses: actions/github-script@v6
71-
with:
72-
script: |
73-
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
74-
buildComplexEnvVars(core, context)
75-
- name: 'cache yarn cache'
76-
uses: actions/cache@v3
77-
with:
78-
path: |
79-
${{ github.workspace }}/.npm-cache/_prebuild
80-
${{ github.workspace }}/.yarn-cache
81-
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
82-
- name: 'setup-js'
83-
run: |
84-
npm config set cache ${{ github.workspace }}/.npm-cache
85-
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
86-
make setup-js
60+
- uses: ./.github/actions/js/setup
8761
- name: 'test frontend packages'
8862
run: |
8963
make -C app test-cov
@@ -108,45 +82,12 @@ jobs:
10882
- uses: 'actions/checkout@v4'
10983
with:
11084
fetch-depth: 0
111-
# https://github.com/actions/checkout/issues/290
112-
- name: 'Fix actions/checkout odd handling of tags'
113-
if: startsWith(github.ref, 'refs/tags')
114-
run: |
115-
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
116-
git checkout ${{ github.ref }}
117-
- uses: 'actions/setup-node@v4'
118-
with:
119-
node-version: '22.11.0'
85+
- uses: ./.github/actions/js/setup
12086
- uses: actions/setup-python@v4
12187
with:
12288
python-version: '3.10'
12389
- name: check make version
12490
run: make --version
125-
- name: 'install libudev and libsystemd'
126-
if: startsWith(matrix.os, 'ubuntu')
127-
run: |
128-
# WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
129-
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
130-
sudo apt-get update && sudo apt-get install libudev-dev
131-
- name: 'set complex environment variables'
132-
id: 'set-vars'
133-
uses: actions/github-script@v6
134-
with:
135-
script: |
136-
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
137-
buildComplexEnvVars(core, context)
138-
- name: 'cache yarn cache'
139-
uses: actions/cache@v3
140-
with:
141-
path: |
142-
${{ github.workspace }}/.npm-cache/_prebuild
143-
${{ github.workspace }}/.yarn-cache
144-
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
145-
- name: setup-js
146-
run: |
147-
npm config set cache ${{ github.workspace }}/.npm-cache
148-
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
149-
make setup-js
15091
- name: 'test native(er) packages'
15192
run: make test-js-internal tests="${{matrix.shell}}/src" cov_opts="--coverage=true"
15293
- name: 'Upload coverage report'
@@ -264,46 +205,12 @@ jobs:
264205
- uses: 'actions/checkout@v4'
265206
with:
266207
fetch-depth: 0
267-
# https://github.com/actions/checkout/issues/290
268-
- name: 'Fix actions/checkout odd handling of tags'
269-
if: startsWith(github.ref, 'refs/tags')
270-
run: |
271-
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
272-
git checkout ${{ github.ref }}
273-
- uses: 'actions/setup-node@v4'
274-
with:
275-
node-version: '22.11.0'
208+
- uses: ./.github/actions/js/setup
276209
- uses: actions/setup-python@v4
277210
with:
278211
python-version: '3.10'
279212
- name: check make version
280213
run: make --version
281-
- name: 'install libudev and libsystemd'
282-
if: startsWith(matrix.os, 'ubuntu')
283-
run: |
284-
# WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
285-
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
286-
sudo apt-get update && sudo apt-get install libudev-dev
287-
- name: 'set complex environment variables'
288-
id: 'set-vars'
289-
uses: actions/github-script@v6
290-
with:
291-
script: |
292-
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
293-
buildComplexEnvVars(core, context)
294-
- name: 'cache yarn cache'
295-
uses: actions/cache@v3
296-
with:
297-
path: |
298-
${{ github.workspace }}/.npm-cache/_prebuild
299-
${{ github.workspace }}/.yarn-cache
300-
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
301-
- name: setup-js
302-
run: |
303-
npm config set cache ${{ github.workspace }}/.npm-cache
304-
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
305-
make setup-js
306-
307214
- name: 'Configure Windows code signing environment'
308215
if: startsWith(matrix.os, 'windows') && contains(needs.determine-build-type.outputs.type, 'release')
309216
shell: bash
@@ -491,40 +398,7 @@ jobs:
491398
uses: 'actions/checkout@v4'
492399
with:
493400
path: ./monorepo
494-
# https://github.com/actions/checkout/issues/290
495-
- name: 'Fix actions/checkout odd handling of tags'
496-
if: startsWith(github.ref, 'refs/tags')
497-
run: |
498-
cd ./monorepo
499-
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
500-
git checkout ${{ github.ref }}
501-
- uses: 'actions/setup-node@v4'
502-
with:
503-
node-version: '22.11.0'
504-
- name: 'install udev'
505-
run: |
506-
# WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
507-
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
508-
sudo apt-get update && sudo apt-get install libudev-dev
509-
- name: 'set complex environment variables'
510-
id: 'set-vars'
511-
uses: actions/github-script@v6
512-
with:
513-
script: |
514-
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/monorepo/.github/workflows/utils.js`)
515-
buildComplexEnvVars(core, context)
516-
- name: 'cache yarn cache'
517-
uses: actions/cache@v3
518-
with:
519-
path: |
520-
${{ github.workspace }}/.npm-cache/_prebuild
521-
${{ github.workspace }}/.yarn-cache
522-
- name: 'setup-js'
523-
run: |
524-
npm config set cache ${{ github.workspace }}/.npm-cache
525-
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
526-
cd monorepo
527-
make setup-js
401+
- uses: ./.github/actions/js/setup
528402
- name: 'update internal-releases releases.json'
529403
if: needs.determine-build-type.outputs.type == 'release' && contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
530404
run: |

0 commit comments

Comments
 (0)