-
Notifications
You must be signed in to change notification settings - Fork 128
57 lines (56 loc) · 1.86 KB
/
continuous-integration.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
name: Continuous integration
on:
pull_request:
workflow_call:
inputs:
ref:
description: 'Git commit to build and test'
required: false
type: string
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Cache the node_modules dir
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }}
- name: Install
run: yarn install --immutable
- name: Format
run: make checkformatting
- name: Lint & typecheck
run: make lint
- name: Test
run: make test
- name: Fetch git tags
run: |
# Fetch tags because `git describe` uses them and the output from `git describe`
# is in turn used to produce the extension version number in `build/manifest.json`.
#
# GitHub does a shallow clone by default, so we have to un-shallow it for
# `git describe` to work.
git fetch --quiet --tags --unshallow
# Show version information in the build logs. This command will also be
# used by `tools/settings.js` to generate the extension version.
git describe --tags
- name: Build packages
run: |
make clean # Remove assets from test step
make build SETTINGS_FILE=settings/chrome-staging.json dist/ci-chrome-staging.zip
make build SETTINGS_FILE=settings/chrome-prod.json dist/ci-chrome-prod.zip
make build SETTINGS_FILE=settings/firefox-staging.json dist/ci-firefox-staging.xpi
make build SETTINGS_FILE=settings/firefox-prod.json dist/ci-firefox-prod.xpi
- name: Archive packages
uses: actions/upload-artifact@v4
with:
name: packages
path: |
dist/*.zip
dist/*.xpi
retention-days: 30