-
Notifications
You must be signed in to change notification settings - Fork 7
86 lines (67 loc) · 2.16 KB
/
ci.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
79
80
81
82
83
84
85
86
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
NODE_OPTIONS: '--max_old_space_size=8192'
jobs:
lint-and-format:
name: Run eslint and check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup antlr4
uses: ./.github/actions/setup-antlr4
- name: Install dependencies with frozen lock file and generate parser
run: npm ci
- name: Build project
env:
NODE_OPTIONS: '--max_old_space_size=8192'
run: npm run build
- name: Check there are no linting errors
run: npm run lint
- name: List files that have not been formatted properly
run: |
npm run format
(git diff-index --name-status HEAD | grep ".*\.ts" && exit 1) || echo "\n\nAll Typescript files are correctly formatted"
unit-test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup antlr4
uses: ./.github/actions/setup-antlr4
- name: Install dependencies with frozen lock file and generate parser
run: npm ci
- name: Builds and run tests
# Tests with the same flags that VSCode does
run: |
npm test -- --filter=!antlr4 -- --passWithNoTests
npm test -- --filter=antlr4
e2e-test:
name: E2E tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup antlr4
uses: ./.github/actions/setup-antlr4
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run e2e test
# We need a graphics server to run integration tests with VSCode
# https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions
run: xvfb-run -a npm run test:e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: packages/react-codemirror/playwright-report/
retention-days: 30