-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (154 loc) · 4.71 KB
/
Copy pathpull-request.yml
File metadata and controls
166 lines (154 loc) · 4.71 KB
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
name: Atom
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
get_release_version:
name: Get Release Version
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: script/vsts
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '12.18.3'
cache: 'npm'
- run: npm install
- run: node get-release-version.js
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: script
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '12.18.3'
- name: Cache script dependencies
id: script-deps
uses: actions/cache@v2
with:
path: script/node_modules
key: ${{ runner.os }}-script-${{ hashFiles('script/package-lock.json') }}
- run: npm install
if: steps.script-deps.outputs.cache-hit != 'true'
- run: ./lint
build:
name: Build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs: [get_release_version, lint]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '12.18.3'
- name: Cache script dependencies
id: script-deps
uses: actions/cache@v2
with:
path: script/node_modules
key: ${{ matrix.os }}-script-${{ hashFiles('script/package-lock.json') }}
- name: Cache apm dependencies
id: apm-deps
uses: actions/cache@v2
with:
path: apm/node_modules
key: ${{ matrix.os }}-apm-${{ hashFiles('apm/package-lock.json') }}
- name: Cache core dependencies
id: core-deps
uses: actions/cache@v2
with:
path: node_modules
key: ${{ matrix.os }}-core-deps-${{ hashFiles('package-lock.json') }}
- name: Install script dependencies
if: steps.script-deps.outputs.cache-hit != 'true'
run: |
cd script
npm install
- name: Install apm
if: steps.apm-deps.outputs.cache-hit != 'true'
run: |
cd apm
npm install
- name: Install core dependencies
if: steps.core-deps.outputs.cache-hit != 'true'
run: |
npm install
npx electron-rebuild -v 11.4.12
- run: script/build --no-bootstrap
- name: Tar output
run: tar -cvf atom-${{ matrix.os }}.tar out
- uses: actions/upload-artifact@v2
with:
name: atom-${{ matrix.os }}
path: atom-${{ matrix.os }}.tar
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
test_type: [ATOM_RUN_CORE_TESTS, ATOM_RUN_CORE_MAIN_TESTS, ATOM_RUN_CORE_RENDER_TESTS, ATOM_RUN_PACKAGE_TESTS]
runs-on: ${{ matrix.os }}
needs: [build]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '12.18.3'
- uses: actions/download-artifact@v2
name: Download Artifact
with:
name: atom-${{ matrix.os }}
- name: Extract Artifact
run: tar -xvf atom-${{ matrix.os }}.tar -C .
- name: Restor script dependencies
uses: actions/cache@v2
with:
path: script/node_modules
key: ${{ matrix.os }}-script-${{ hashFiles('script/package-lock.json') }}
- name: Restore apm dependencies
uses: actions/cache@v2
with:
path: apm/node_modules
key: ${{ matrix.os }}-apm-${{ hashFiles('apm/package-lock.json') }}
- name: Restore core dependencies
id: core-deps
uses: actions/cache@v2
with:
path: node_modules
key: ${{ matrix.os }}-core-deps-${{ hashFiles('package-lock.json') }}
- name: Run test
uses: GabrielBB/xvfb-action@v1
if: ${{ matrix.os == 'ubuntu-latest' && matrix.test_type == 'ATOM_RUN_CORE_MAIN_TESTS'}}
with:
run: |
echo "${{ matrix.test_type}}=true" >> $GITHUB_ENV
script/test
- name: Run test
uses: GabrielBB/xvfb-action@v1
if: ${{ matrix.os == 'macos-latest' }}
with:
run: |
echo "${{ matrix.test_type}}='true'" >> $GITHUB_ENV
script/test
- name: Run test
uses: GabrielBB/xvfb-action@v1
if: ${{ matrix.os == 'windows-latest' && matrix.test_type != 'ATOM_RUN_PACKAGE_TESTS'}}
with:
run: |
echo "${{ matrix.test_type}}='true'" >> $GITHUB_ENV
script/test