20
20
pr_git_sha : ${{ steps.set_pr_git_sha.outputs.pr_git_sha }}
21
21
22
22
steps :
23
+ # For non-fork PRs
24
+ - uses : actions/checkout@v2
25
+ if : ${{ github.event.inputs.pull_request_id == '' }}
26
+ with :
27
+ ref : ${{ github.event.inputs.sha || github.ref }}
28
+
23
29
# For manually run PRs
24
30
- name : Initialize empty git repository
25
31
if : ${{ github.event.inputs.pull_request_id != '' }}
50
56
sha : ${{ steps.set_pr_git_sha.outputs.pr_git_sha || github.event.inputs.sha || github.sha }}
51
57
target_url : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
52
58
59
+ - name : Use Node.js ${{ matrix.node-version }}
60
+ uses : actions/setup-node@v2
61
+ with :
62
+ node-version : " 12.x"
63
+
64
+ - name : Build
65
+ run : yarn --frozen-lockfile
66
+
67
+ - name : Install test utils
68
+ run : |
69
+ cd packages/e2e-tests/test-utils
70
+ yarn --frozen-lockfile
71
+
72
+ - name : " Compress build"
73
+ run : tar -caf build.tar.gz ./packages ./node_modules
74
+
75
+ - name : Wait for existing workflow to complete before e2e tests
76
+ uses : softprops/turnstyle@v1
77
+ with :
78
+ poll-interval-seconds : 15
79
+ same-branch-only : false
80
+ env :
81
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
82
+
83
+ - name : " Upload build"
84
+ uses : actions/upload-artifact@v2
85
+ with :
86
+ name : build.tar.gz
87
+ path : build.tar.gz
88
+ retention-days : 1
89
+
53
90
run-e2e-tests :
54
91
needs : [initialize]
55
92
runs-on : [ubuntu-latest]
@@ -96,21 +133,13 @@ jobs:
96
133
with :
97
134
node-version : ${{ matrix.node-version }}
98
135
99
- - run : yarn --frozen-lockfile
100
- # TODO: build once and cache for all e2e tests
101
-
102
- - name : Install test utils
103
- run : |
104
- cd packages/e2e-tests/test-utils
105
- yarn --frozen-lockfile
106
-
107
- - name : Wait for existing workflow to complete before e2e tests
108
- uses : softprops/turnstyle@v1
136
+ - name : " Download build"
137
+ uses : actions/download-artifact@v2
109
138
with :
110
- poll-interval-seconds : 15
111
- same-branch-only : false
112
- env :
113
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
139
+ name : build.tar.gz
140
+
141
+ - name : " Uncompress build "
142
+ run : tar -xf build.tar.gz
114
143
115
144
- name : Run e2e tests
116
145
env :
@@ -125,6 +154,7 @@ jobs:
125
154
yarn --frozen-lockfile
126
155
sleep $[($RANDOM % 15) + 1]s # Sleep 1-15 seconds to try to avoid throttling
127
156
yarn e2e:ci
157
+ timeout-minutes : 30 # In case something goes wrong
128
158
129
159
- name : Mark end-to-end tests as failed
130
160
# For manual runs (e.g for fork PRs) don't update commit status as there won't be permissions to do so
0 commit comments