-
Notifications
You must be signed in to change notification settings - Fork 72
78 lines (64 loc) · 2.15 KB
/
template-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
75
76
77
78
name: 📄 Main CI - template
on:
workflow_call:
inputs:
version:
required: true
type: string
nodejs:
required: false
default: "20.x"
type: string
code_type:
required: false
default: "stable"
type: string
jobs:
test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-latest, windows-latest]
fail-fast: false
env:
CODE_TYPE: ${{ inputs.code_type }}
CODE_VERSION: ${{ inputs.version }}
TEST_RESOURCES: test-resources
steps:
- name: 👷🏻 Checkout Repository
uses: actions/checkout@v4
- name: ⚙️ Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodejs }}
cache: npm
- name: 🔧 Install
run: npm ci
- name: 🔧 Build
run: npm run build
- name: ✨ Code Formatter - Prettier
run: npx prettier . --check
- name: 🔧 Install - Test Project
run: npm install --workspace=extester-test
- name: 🔍 Run Tests (macOS, windows)
if: ${{ ! startsWith(matrix.os, 'ubuntu') }}
run: npm test
- name: ⚙️ Allow unprivileged user namespace (ubuntu)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: 🔍 Run Tests (linux)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test
- name: 💾 Upload Screenshots
uses: actions/upload-artifact@v4
if: failure() && inputs.nodejs != 'lts/*'
with:
name: screenshots-${{ matrix.os }}-${{ inputs.version }}-node_${{ inputs.nodejs }}
path: ${{ github.workspace }}/tests/**/screenshots/*.png
- name: 💾 Upload Screenshots
uses: actions/upload-artifact@v4
if: failure() && inputs.nodejs == 'lts/*'
with:
name: screenshots-${{ matrix.os }}-${{ inputs.version }}-node_lts
path: ${{ github.workspace }}/tests/**/screenshots/*.png