-
Notifications
You must be signed in to change notification settings - Fork 16
74 lines (70 loc) · 2.01 KB
/
test.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
name: Tests
on:
pull_request:
push:
branches:
- main
# cancel old edit events being processed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: 👷 Install Dependencies
run: npm ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🧪 Setup and Test with Runme
uses: coactions/setup-xvfb@v1
with:
run: npx runme run configureNPM setup build test:ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUNME_TEST_TOKEN: ${{ secrets.RUNME_TEST_TOKEN }}
RUNME_PROJECT: ${{ github.workspace }}
SHELL: bash
- name: 🔼 Upload Artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots
path: |
tests/e2e/screenshots
tests/e2e/logs
- name: 🔼 Upload coverage
uses: actions/upload-artifact@v3
if: ${{github.actor != 'dependabot[bot]' && matrix.os == 'ubuntu-latest'}}
with:
name: coverage
path: ./coverage
if-no-files-found: error
- name: 🐛 Debug Build
uses: stateful/vscode-server-action@v1
if: failure()
with:
timeout: "300000"
sonarcloud:
if: ${{github.actor != 'dependabot[bot]'}}
name: SonarCloud Analysis
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Retrieve saved coverage
uses: actions/download-artifact@v3
with:
name: coverage
path: ./coverage
- name: SonarCloud Scan
uses: SonarSource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}