44
44
runs-on : ' ubuntu-24.04'
45
45
steps :
46
46
- uses : ' actions/checkout@v4'
47
- - uses : ' actions/setup-node@v4'
48
- with :
49
- node-version : ' 22.11.0'
50
- - name : ' install udev for usb-detection'
51
- run : |
52
- # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
53
- sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
54
- sudo apt-get update && sudo apt-get install libudev-dev
55
- - name : ' cache yarn cache'
56
- uses : actions/cache@v4
57
- with :
58
- path : |
59
- ${{ github.workspace }}/.yarn-cache
60
- ${{ github.workspace }}/.npm-cache
61
- key : js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
62
- restore-keys : |
63
- js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
64
- - name : ' setup-js'
65
- run : |
66
- npm config set cache ./.npm-cache
67
- make setup-js
47
+ - uses : ./.github/actions/js/setup
68
48
- name : ' run components unit tests'
69
49
run : make -C components test-cov
70
50
- name : ' Upload coverage report'
80
60
needs : ['js-unit-test']
81
61
steps :
82
62
- uses : ' actions/checkout@v4'
83
- - uses : ' actions/setup-node@v4'
84
- with :
85
- node-version : ' 22.11.0'
86
- - name : ' install udev for usb-detection'
87
- run : |
88
- # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
89
- sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
90
- sudo apt-get update && sudo apt-get install libudev-dev
91
- - name : ' cache yarn cache'
92
- uses : actions/cache@v4
93
- with :
94
- path : |
95
- ${{ github.workspace }}/.yarn-cache
96
- ${{ github.workspace }}/.npm-cache
97
- key : js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
98
- restore-keys : |
99
- js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
100
- - name : ' setup-js'
101
- run : |
102
- npm config set cache ./.npm-cache
103
- yarn config set cache-folder ./.yarn-cache
104
- make setup-js
63
+ - uses : ./.github/actions/js/setup
105
64
- name : ' build components'
106
65
run : make -C components
107
66
- name : ' upload github artifact'
@@ -141,22 +100,7 @@ jobs:
141
100
if : needs.determine-build-type.outputs.type != 'none'
142
101
steps :
143
102
- uses : ' actions/checkout@v4'
144
- # https://github.com/actions/checkout/issues/290
145
- - name : ' Fix actions/checkout odd handling of tags'
146
- if : startsWith(github.ref, 'refs/tags')
147
- run : |
148
- git fetch -f origin ${{ github.ref }}:${{ github.ref }}
149
- git checkout ${{ github.ref }}
150
- - uses : ' actions/setup-node@v4'
151
- with :
152
- node-version : ' 22.11.0'
153
- - name : ' set complex environment variables'
154
- id : ' set-vars'
155
- uses : actions/github-script@v6
156
- with :
157
- script : |
158
- const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
159
- buildComplexEnvVars(core, context)
103
+ - uses : ./.github/actions/js/setup
160
104
- name : ' download components build'
161
105
uses : ' actions/download-artifact@v4'
162
106
with :
@@ -181,26 +125,7 @@ jobs:
181
125
if : needs.determine-build-type.outputs.type == 'publish'
182
126
steps :
183
127
- uses : ' actions/checkout@v4'
184
- # https://github.com/actions/checkout/issues/290
185
- - name : ' Fix actions/checkout odd handling of tags'
186
- if : startsWith(github.ref, 'refs/tags')
187
- run : |
188
- git fetch -f origin ${{ github.ref }}:${{ github.ref }}
189
- git checkout ${{ github.ref }}
190
- - uses : ' actions/setup-node@v4'
191
- with :
192
- node-version : ' 22.11.0'
193
- registry-url : ' https://registry.npmjs.org'
194
- - name : ' install udev for usb-detection'
195
- run : |
196
- # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
197
- sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
198
- sudo apt-get update && sudo apt-get install libudev-dev
199
- - name : ' setup-js'
200
- run : |
201
- npm config set cache ./.npm-cache
202
- yarn config set cache-folder ./.yarn-cache
203
- make setup-js
128
+ - uses : ./.github/actions/js/setup
204
129
- name : ' build typescript types'
205
130
run : make -C components build-ts
206
131
# replace package.json stub version number with version from tag
@@ -211,10 +136,7 @@ jobs:
211
136
json -I -f ./components/package.json -e "this.version=\"$VERSION_STRING\""
212
137
json -I -f ./components/package.json -e "this.dependencies['@opentrons/shared-data']=\"$VERSION_STRING\""
213
138
json -I -f ./components/package.json -e "delete this.dependencies['@opentrons/step-generation']"
214
- - uses : ' actions/setup-node@v4'
215
- with :
216
- node-version : ' 22.11.0'
217
- registry-url : ' https://registry.npmjs.org'
139
+
218
140
- name : ' publish to npm registry'
219
141
env :
220
142
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments