-
Notifications
You must be signed in to change notification settings - Fork 29
87 lines (85 loc) · 2.28 KB
/
main.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
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Doenet CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prettify
uses: creyD/[email protected]
with:
prettier_options: --write ./src/**/*.{jsx,json,php}
prettier_plugins: '@prettier/plugin-php'
dry: true
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Node setup
uses: actions/setup-node@v2
with:
node_version: '14'
- name: Deps install
run: npm install
- name: Lint
run: npx eslint "./src/**/*.{jsx,js}"
install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create cache
uses: actions/cache@v2
id: npm-and-build-cache
with:
path: |
~/.cache/Cypress
dist_ci
node_modules
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-build-
- name: Install cypress
uses: cypress-io/github-action@v2
with:
runTests: false
build: npm run build:ci
ui-tests:
name: ${{ matrix.browser }} tests
runs-on: ubuntu-latest
needs: install
strategy:
fail-fast: false
matrix:
browser: [chrome, firefox]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Retrive cache
uses: actions/cache@v2
id: npm-and-build-cache
with:
path: |
~/.cache/Cypress
dist_local
node_modules
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-build-
- name: Cypress ${{ matrix.browser }} run
uses: cypress-io/github-action@v2
with:
install: false
start: npm run start:ci
wait-on: 'http://localhost'
wait-on-timeout: 180
browser: ${{matrix.browser}}
headless: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}