-
Notifications
You must be signed in to change notification settings - Fork 47
55 lines (55 loc) · 1.96 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
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: supercharge/mongodb-github-action@1.3.0
with:
mongodb-version: 4.2
- run: npm install
- name: Instantiate github-keys.json
run: 'echo "{ \"clientID\": \"clientID\", \"clientSecret\": \"clientSecret\", \"callbackURL\": \"http://localhost:3001/auth/github/callback\"}" > github-keys.json'
- name: Instantiate blacklist
run: echo {} > controller/atlasmakerServer/blacklist.json
- name: Instantiate whitelist
run: echo "{}" > controller/atlasmakerServer/whitelist.json
- name: Instantiate websocket configuration file
run: cp cfg.json.example cfg.json
- run: npm run build
- name: Run server
run: timeout 3 npm start || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
- name: Run unit tests
run: npm run test-unit
- name: Upload unit tests coverage to Codecov
uses: codecov/codecov-action@v2
with:
directory: ./test/unit/coverage
flags: unittests
- name: Run integration tests
run: npm run test-integration
- name: Upload integration tests coverage to Codecov
uses: codecov/codecov-action@v2
with:
directory: ./test/integration/coverage
flags: integration
- name: Archive screenshots
if: always()
uses: actions/upload-artifact@v2
with:
name: screenshots
path: test/screenshots/
deploy:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Invoke deployment hook
uses: distributhor/workflow-webhook@v1
env:
webhook_url: ${{ secrets.WEBHOOK_URL }}
webhook_secret: ${{ secrets.WEBHOOK_SECRET }}