-
-
Notifications
You must be signed in to change notification settings - Fork 137
65 lines (51 loc) · 1.96 KB
/
tests.yml
File metadata and controls
65 lines (51 loc) · 1.96 KB
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ devel ]
pull_request:
branches: [ devel ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14.x, 15.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.4.0
with:
cache: npm
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Run example script
env:
DEBUG: "phantomas:browser"
run: node examples/index.js https://gf.dev/http3-test
- name: Run tests
run: |
set -o pipefail
./test/server-start.sh
npm test 2>&1 | tee /tmp/npm-test.log
- name: Code coverage to be improved
run: |
cat /tmp/npm-test.log | grep '|' | head -n4
cat /tmp/npm-test.log | grep '|' | grep -v '100 | 100 | 100 | 10' | grep '\.js'
# https://github.com/marketplace/actions/coveralls-github-action
# upload coverage report for just one of Node.js version matrix runs
- name: Upload coverage report to Coveralls
if: matrix.node-version == '16.x'
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ github.token }}
- name: Check that bin/phantomas.js works
run: |
set -x
./bin/phantomas.js http://127.0.0.1:8888/ --pretty | grep "generator" -A4
./bin/phantomas.js https://127.0.0.1:8889/ --ignore-ssl-errors --pretty | grep "generator" -A4
- name: Check that bin/phantomas.js handles errors correctly
run: ./bin/phantomas.js http://127.0.0.1:1234/ 2>&1 | grep "net::ERR_CONNECTION_REFUSED at http://127.0.0.1:1234"