-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
189 lines (163 loc) Β· 5.95 KB
/
integration-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
on:
push:
branches:
- master
pull_request:
name: 'Integration'
jobs:
chore:
name: 'Testing chores'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: |
git fetch --no-tags --unshallow origin HEAD master
- name: 'Use Node.js 12.x'
uses: actions/setup-node@master
with:
node-version: 12.x
- name: 'Check that the Yarn files don''t change on new installs (fix w/ "yarn install")'
run: |
node ./scripts/run-yarn.js --immutable --immutable-cache
shell: bash
env:
YARN_ENABLE_NETWORK: 0
- name: 'Check that the cache files are consistent with their remote sources'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- .yarn/cache | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js --immutable --immutable-cache --check-cache
fi
shell: bash
if: |
github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the patch files are consistent with fresh builds'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- packages/plugin-compat/sources/patches | wc -l) -gt 0 ]]; then
for generator in packages/plugin-compat/extra/*/gen-*-patch.sh; do
bash $generator;
done
for generator in packages/plugin-compat/extra/*/gen-*-patch.js; do
yarn node $generator;
done
[[ $(git diff --name-only packages/plugin-compat/sources/patches | tee /dev/stderr | wc -l) -eq 0 ]]
fi
shell: bash
if: |
github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the PnP hook is consistent with a fresh build (fix w/ "git merge master && yarn update:pnp:hook")'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- packages/yarnpkg-pnp/sources/hook.js | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js build:pnp:hook
[[ $(git diff --name-only packages/yarnpkg-pnp/sources/hook.js | wc -l) -eq 0 ]]
fi
shell: bash
if: |
github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the pluginCommands file is consistent with a fresh build (fix w/ "yarn build:plugin-commands")'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- packages/yarnpkg-cli/sources/pluginCommands.ts 'packages/*/sources/commands/**/*' | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js build:plugin-commands
[[ $(git diff --name-only packages/yarnpkg-cli/sources/pluginCommands.ts | tee /dev/stderr | wc -l) -eq 0 ]]
fi
shell: bash
if: |
github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the PR describes which packages should be bumped (fix w/ "yarn version check -i")'
run: |
node ./scripts/run-yarn.js version check
shell: bash
if: |
github.event.pull_request != ''
- name: 'Check for linting errors (fix w/ "yarn test:lint --fix")'
run: |
node ./scripts/run-yarn.js test:lint
shell: bash
- name: 'Check for unmet constraints (fix w/ "yarn constraints --fix")'
run: |
node ./scripts/run-yarn.js constraints
shell: bash
- name: 'Check for type errors'
run: |
node ./scripts/run-yarn.js typecheck:all
shell: bash
build:
name: 'Build artifacts'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: 'Use Node.js 14.x'
uses: actions/setup-node@master
with:
node-version: 14.x
- name: 'Build bundle & plugins'
run: |
export BUILD_MONITORING_ENABLED=1
node --version
node ./scripts/run-yarn.js build:pnp:hook
node ./scripts/run-yarn.js build:cli
mv ./packages/yarnpkg-cli/bundles/yarn.js ./packages/yarnpkg-cli/bundles/yarn-min.js
node ./scripts/run-yarn.js build:cli --no-minify
node ./scripts/run-yarn.js build:plugin-constraints
node ./scripts/run-yarn.js build:plugin-exec
node ./scripts/run-yarn.js build:plugin-interactive-tools
node ./scripts/run-yarn.js build:plugin-stage
node ./scripts/run-yarn.js build:plugin-typescript
node ./scripts/run-yarn.js build:plugin-version
node ./scripts/run-yarn.js build:plugin-workspace-tools
shell: bash
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
- uses: actions/upload-artifact@v2
with:
name: yarn-artifacts
path: |
./packages/*/bundles
./packages/yarnpkg-pnp/sources/hook.js
- name: 'Build vscode-zipfs'
run: |
node ./scripts/run-yarn.js package:vscode-zipfs
- uses: actions/upload-artifact@v2
with:
name: vscode-zipfs
path: ./packages/vscode-zipfs/vscode-zipfs-*.vsix
acceptance:
strategy:
fail-fast: false
matrix:
node:
- 12
- 14
- 15
platform:
- ubuntu-latest
- windows-latest
- macos-latest
name: '${{matrix.platform}} w/ Node.js ${{matrix.node}}.x'
runs-on: ${{matrix.platform}}
needs: build
steps:
- uses: actions/checkout@master
- name: 'Use Node.js ${{matrix.node}}.x'
uses: actions/setup-node@master
with:
node-version: ${{matrix.node}}.x
- uses: actions/download-artifact@v2
with:
name: yarn-artifacts
path: packages
- name: 'Run the integration tests'
run: |
node ./scripts/run-yarn.js test:integration --runInBand
shell: bash
- name: 'Run the unit tests'
run: |
node ./scripts/run-yarn.js test:unit
shell: bash