-
-
Notifications
You must be signed in to change notification settings - Fork 107
57 lines (53 loc) · 1.39 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
# Runs CI tests: Nightwatch and linting
name: Continuous Integration tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- name: 'Install Node.js'
uses: actions/setup-node@v1
with:
node-version: '20.x'
- name: 'Install dependencies from npm'
run: |
npm install
- name: 'Build example project'
run: |
npm run build-test-app
- name: 'Start test containers'
run: |
# We can't use a GitHub Action service because they start before the source is cloned, and that causes issues
# Nginx
docker run \
-d \
--name nginx \
-v ${{ github.workspace }}/test/app/dist:/usr/share/nginx/html:ro \
nginx:1.19
# Selenium with Chrome
docker run \
-d \
--name selenium-chrome \
-p 4444:4444 \
--link nginx \
--shm-size=2g \
selenium/standalone-chrome:119.0
# Wait 5 seconds
sleep 5
- name: 'Run tests'
run: |
npm run test
env:
SELENIUM_HOST: '127.0.0.1'
SELENIUM_PORT: '4444'
LAUNCH_URL: 'http://nginx'
- name: 'Run linter'
run: |
npm run lint