-
Notifications
You must be signed in to change notification settings - Fork 3
192 lines (157 loc) · 4.96 KB
/
on_commit.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
190
191
192
---
name: CI
on: [push, pull_request]
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
node_modules
packages/landing/data
packages/bundle/data
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-v3
- name: Install node_modules
run: yarn --frozen-lockfile
- name: Run ESLint / Prettier
run: make --output-sync --jobs lint
- name: Install additional dependencies
run: make --jobs primary-deps
env:
MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }}
test:
name: Unit-testing
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Restore caches
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
node_modules
packages/landing/data
packages/bundle/data
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-v3
- name: Install node_modules
run: yarn --frozen-lockfile
- name: Run unit tests
run: make --output-sync --jobs test
env:
MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }}
- name: Upload coverage to Coveralls.io
if: ${{ always() }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage to Codecov.io
if: ${{ always() }}
uses: codecov/codecov-action@v1
- name: Upload report to Code Climate
if: ${{ always() }}
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
build:
name: Building
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Restore caches
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
node_modules
packages/landing/data
packages/bundle/data
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-v3
- name: Install node_modules
run: yarn --frozen-lockfile
- name: Build Firefox & Chromium runtimes
run: make --output-sync --jobs outdated build.firefox build.chromium
env:
MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }}
- name: Save Firefox artifacts
uses: actions/upload-artifact@v2
with:
name: firefox-bundle
path: packages/firefox/bundle/
if-no-files-found: error
- name: Save Chromium artifacts
uses: actions/upload-artifact@v2
with:
name: chromium-bundle
path: packages/chromium/bundle/
if-no-files-found: error
- name: Bundlewatch
uses: jackyef/bundlewatch-gh-action@master
with:
bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
publish:
name: Publishing
if: github.ref == 'refs/heads/main'
needs: [test, build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Restore caches
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
node_modules
packages/landing/data
packages/bundle/data
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}-v3
- name: Install node_modules
run: yarn --frozen-lockfile
- name: Download Firefox bundle
uses: actions/download-artifact@v2
with:
name: firefox-bundle
path: packages/firefox/bundle/
- name: Download Chromium bundle
uses: actions/download-artifact@v2
with:
name: chromium-bundle
path: packages/chromium/bundle/
- name: Zip
run: make --output-sync --jobs packages/firefox/firefox.zip packages/chromium/chromium.zip
- name: Update Release
uses: johnwbyrd/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
release: unstable
files: packages/firefox/firefox.zip packages/chromium/chromium.zip