-
Notifications
You must be signed in to change notification settings - Fork 75
68 lines (59 loc) · 2 KB
/
tests.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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
# docs: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: 🧪 Tests
on:
workflow_dispatch: {}
push:
branches: [master, main]
tags-ignore: ['**']
paths-ignore: ['**.md', 'website/**', 'static/**']
pull_request:
paths-ignore: ['**.md', 'website/**', 'static/**']
concurrency:
group: ${{ github.ref }}-tests
cancel-in-progress: true
env: {FORCE_COLOR: 'true'}
jobs:
gitleaks:
name: Check for GitLeaks
runs-on: ubuntu-latest
steps:
- {uses: actions/checkout@v4, with: {fetch-depth: 0}}
- uses: gacts/gitleaks@v1
unit-tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- {uses: actions/setup-node@v4, with: {node-version: 21, cache: 'npm'}}
- run: npm install
- run: npm run test
eslint:
name: Run code linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- {uses: actions/setup-node@v4, with: {node-version: 21, cache: 'npm'}}
- run: npm install
- run: npm run lint
build:
name: Build extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- {uses: actions/setup-node@v4, with: {node-version: 21, cache: 'npm'}}
- run: npm install
- run: npm run build
- uses: actions/upload-artifact@v4
with: {name: chrome.zip, path: ./dist/chrome.zip, if-no-files-found: error, retention-days: 30}
- uses: actions/upload-artifact@v4
with: {name: firefox.zip, path: ./dist/firefox.zip, if-no-files-found: error, retention-days: 30}
addons-linter:
name: Run addon linter (mozilla)
runs-on: ubuntu-latest
needs: [build]
steps:
- {uses: actions/download-artifact@v4, with: {name: firefox.zip, path: dist}}
- {uses: actions/setup-node@v4, with: {node-version: 21}}
- run: npm install -g addons-linter
- run: addons-linter ./dist/firefox.zip