-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (71 loc) · 1.93 KB
/
main.yaml
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
---
name: Lint and test
# yamllint disable rule:truthy
on:
push:
branches:
- main
- dev
workflow_dispatch:
merge_group:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Yarn
run: |
corepack enable
yarn set version stable
- name: Install dependencies
run: yarn install
- name: Lint
run: yarn run lint
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Setup Yarn
run: |
corepack enable
yarn set version stable
- name: Install dependencies
run: yarn install
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Display Python version
run: python --version
- name: Run tests on ubuntu-latest
run: |
sudo apt update && sudo apt install -y xvfb libasound2t64 libgbm1 libgtk-3-0t64 libnss3 > /dev/null 2>&1 || true
xvfb-run -a yarn run test
if: runner.os == 'Linux'
- name: Run tests on windows-latest and macos-latest
run: yarn run test
if: runner.os != 'Linux'
# https://github.com/marketplace/actions/alls-green#why
alls-green: # This job does nothing and is only used for the branch protection
name: All Good
if: always()
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}