11
11
- ' components/**'
12
12
- ' package.json'
13
13
- ' .github/workflows/pd-test-build-deploy.yaml'
14
+ - ' .github/actions/js/setup/action.yml'
15
+ - ' .github/actions/git/resolve-tag/action.yml'
16
+ - ' .github/actions/environment/complex-variables/action.yml'
14
17
push :
15
18
paths :
16
19
- ' protocol-designer/**'
19
22
- ' components/**'
20
23
- ' package.json'
21
24
- ' .github/workflows/pd-test-build-deploy.yaml'
25
+ - ' .github/actions/js/setup/action.yml'
26
+ - ' .github/actions/git/resolve-tag/action.yml'
27
+ - ' .github/actions/environment/complex-variables/action.yml'
22
28
branches :
23
29
- ' **'
24
30
tags :
@@ -37,126 +43,42 @@ env:
37
43
CI : true
38
44
39
45
jobs :
40
- js- unit-test :
46
+ unit-test :
41
47
name : ' protocol designer unit tests'
42
- runs-on : ' ubuntu-22 .04'
43
- timeout-minutes : 30
48
+ runs-on : ' ubuntu-24 .04'
49
+ timeout-minutes : 20
44
50
steps :
45
- - uses : ' actions/checkout@v4'
46
- # https://github.com/actions/checkout/issues/290
47
- - name : ' Fix actions/checkout odd handling of tags'
48
- if : startsWith(github.ref, 'refs/tags')
49
- run : |
50
- git fetch -f origin ${{ github.ref }}:${{ github.ref }}
51
- git checkout ${{ github.ref }}
52
- - uses : ' actions/setup-node@v4'
53
- with :
54
- node-version : ' 22.11.0'
55
- - name : ' install udev for usb-detection'
56
- run : |
57
- # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
58
- sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
59
- sudo apt-get update && sudo apt-get install libudev-dev
60
- - name : ' cache yarn cache'
61
- uses : actions/cache@v2
62
- with :
63
- path : |
64
- ${{ github.workspace }}/.yarn-cache
65
- ${{ github.workspace }}/.npm-cache
66
- key : js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
67
- restore-keys : |
68
- js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
69
- - name : ' setup-js'
70
- run : |
71
- npm config set cache ./.npm-cache
72
- yarn config set cache-folder ./.yarn-cache
73
- make setup-js
74
- - name : ' run PD unit tests'
51
+ - name : ' Checkout Repository'
52
+ uses : actions/checkout@v4
53
+ - uses : ./.github/actions/js/setup
54
+ - name : ' run unit tests'
75
55
run : make -C protocol-designer test-cov
76
56
- name : ' Upload coverage report'
77
- uses : codecov/codecov-action@v3
57
+ uses : codecov/codecov-action@v5
78
58
with :
79
- files : ./coverage/lcov.info
80
59
flags : protocol-designer
60
+ token : ${{ secrets.CODECOV_TOKEN }}
81
61
82
62
e2e-test :
83
- name : ' pd e2e tests'
84
- needs : ['js-unit-test']
85
- timeout-minutes : 30
86
- strategy :
87
- matrix :
88
- os : ['ubuntu-22.04']
89
- runs-on : ' ${{ matrix.os }}'
90
- steps :
91
- - uses : ' actions/checkout@v4'
92
- with :
93
- fetch-depth : 0
94
- # https://github.com/actions/checkout/issues/290
95
- - name : ' Fix actions/checkout odd handling of tags'
96
- if : startsWith(github.ref, 'refs/tags')
97
- run : |
98
- git fetch -f origin ${{ github.ref }}:${{ github.ref }}
99
- git checkout ${{ github.ref }}
100
- - uses : ' actions/setup-node@v4'
101
- with :
102
- node-version : ' 22.11.0'
103
- - name : ' install udev for usb-detection'
104
- if : startsWith(matrix.os, 'ubuntu')
105
- run : |
106
- # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
107
- sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
108
- sudo apt-get update && sudo apt-get install libudev-dev
109
- - name : ' cache yarn cache'
110
- uses : actions/cache@v3
111
- with :
112
- path : |
113
- ${{ github.workspace }}/.yarn-cache
114
- ${{ github.workspace }}/.npm-cache
115
- key : js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
116
- restore-keys : |
117
- js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
118
- - name : ' setup-js'
119
- run : |
120
- npm config set cache ./.npm-cache
121
- yarn config set cache-folder ./.yarn-cache
122
- make setup-js
123
- - name : ' test-e2e'
124
- run : make -C protocol-designer test-e2e
63
+ name : ' protocol designer e2e tests'
64
+ runs-on : ' ubuntu-24.04'
65
+ timeout-minutes : 20
66
+ steps :
67
+ - name : ' Checkout Repository'
68
+ uses : actions/checkout@v4
69
+ - uses : ./.github/actions/js/setup
70
+ - name : ' run test-e2e'
71
+ run : make -C protocol-designer test-e2e
72
+
125
73
build-pd :
126
- name : ' build protocol designer artifact'
127
- needs : ['js-unit-test']
128
- runs-on : ' ubuntu-22.04'
74
+ timeout-minutes : 20
75
+ name : ' build protocol designer'
76
+ needs : ['unit-test', 'e2e-test']
77
+ runs-on : ' ubuntu-24.04'
129
78
if : github.event_name != 'pull_request'
130
79
steps :
131
- - uses : ' actions/checkout@v4'
132
- with :
133
- fetch-depth : 0
134
- # https://github.com/actions/checkout/issues/290
135
- - name : ' Fix actions/checkout odd handling of tags'
136
- if : startsWith(github.ref, 'refs/tags')
137
- run : |
138
- git fetch -f origin ${{ github.ref }}:${{ github.ref }}
139
- git checkout ${{ github.ref }}
140
- - uses : ' actions/setup-node@v4'
141
- with :
142
- node-version : ' 22.11.0'
143
- - name : ' install udev for usb-detection'
144
- run : |
145
- # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
146
- sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
147
- sudo apt-get update && sudo apt-get install libudev-dev
148
- - name : ' cache yarn cache'
149
- uses : actions/cache@v3
150
- with :
151
- path : |
152
- ${{ github.workspace }}/.yarn-cache
153
- ${{ github.workspace }}/.npm-cache
154
- key : js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
155
- - name : ' setup-js'
156
- run : |
157
- npm config set cache ./.npm-cache
158
- yarn config set cache-folder ./.yarn-cache
159
- make setup-js
80
+ - uses : actions/checkout@v4
81
+ - uses : ./.github/actions/js/setup
160
82
- name : ' build PD'
161
83
env :
162
84
OT_PD_MIXPANEL_ID : ${{ secrets.OT_PD_MIXPANEL_ID }}
@@ -168,40 +90,28 @@ jobs:
168
90
with :
169
91
name : ' pd-artifact'
170
92
path : protocol-designer/dist
93
+
171
94
deploy-pd :
172
- name : ' deploy PD artifact to S3'
173
- runs-on : ' ubuntu-22.04'
174
- needs : ['js-unit-test', 'build-pd']
95
+ timeout-minutes : 10
96
+ name : ' deploy protocol designer'
97
+ needs : ['build-pd']
98
+ runs-on : ' ubuntu-24.04'
175
99
if : github.event_name != 'pull_request'
176
100
steps :
177
- - uses : ' actions/checkout@v4'
178
- # https://github.com/actions/checkout/issues/290
179
- - name : ' Fix actions/checkout odd handling of tags'
180
- if : startsWith(github.ref, 'refs/tags')
181
- run : |
182
- git fetch -f origin ${{ github.ref }}:${{ github.ref }}
183
- git checkout ${{ github.ref }}
184
- - uses : ' actions/setup-node@v4'
185
- with :
186
- node-version : ' 22.11.0'
187
- - name : ' install udev for usb-detection'
188
- run : |
189
- # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
190
- sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
191
- sudo apt-get update && sudo apt-get install libudev-dev
192
- - name : ' set complex environment variables'
193
- id : ' set-vars'
194
- uses : actions/github-script@v6
195
- with :
196
- script : |
197
- const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
198
- buildComplexEnvVars(core, context)
101
+ - name : ' Checkout Repository'
102
+ uses : actions/checkout@v4
103
+
104
+ - uses : ./.github/actions/git/resolve-tag
105
+
106
+ - uses : ./.github/actions/environment/complex-variables
107
+
199
108
- name : ' download PD build'
200
109
uses : ' actions/download-artifact@v4'
201
110
with :
202
111
name : pd-artifact
203
112
path : ./dist
204
113
- name : ' configure ot3 s3 deploy creds and deploy'
114
+ shell : bash
205
115
env :
206
116
AWS_ACCESS_KEY_ID : ${{ secrets.PD_S3_SANDBOX_KEY_ID }}
207
117
AWS_SECRET_ACCESS_KEY : ${{ secrets.PD_S3_SANDBOX_SECRET }}
@@ -218,4 +128,3 @@ jobs:
218
128
# invalidate both sandbox.opentrons.com and www.sandbox.opentrons.com cloudfront caches
219
129
aws cloudfront create-invalidation --distribution-id ${{ secrets.PD_CLOUDFRONT_SANDBOX_DISTRIBUTION_ID }} --paths "/*" --profile deploy
220
130
aws cloudfront create-invalidation --distribution-id ${{ secrets.PD_CLOUDFRONT_SANDBOX_WWW_DISTRIBUTION_ID }} --paths "/*" --profile deploy
221
- shell : bash
0 commit comments