-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (65 loc) · 1.74 KB
/
test.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
name: Test
# Trigger on push
on:
push:
branches:
- main
jobs:
# build and run tests
build:
runs-on: ubuntu-latest
# setup node, build, run tests and publish if new release
steps:
- name: Checkout GitHub repository
uses: actions/checkout@v2
- name: Set up Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install npm packages
working-directory: ./
run: npm ci
- name: Run Lint
working-directory: ./
run: npm run lint
- name: Build project
working-directory: ./
run: npm run build
test:
runs-on: ubuntu-latest
steps:
- name: checkout Github repository
uses: actions/checkout@v2
- name: set up Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: npm install
working-directory: ./
run: npm ci
- name: npm test
run: npm test
working-directory: ./
- name: Create test coverage artifact
uses: actions/upload-artifact@v1
with:
name: coverage
path: ./coverage
publish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub repository
uses: actions/checkout@master
- name: Download coverage artifact
uses: actions/download-artifact@v1
with:
name: coverage
- name: Publish test coverage
uses: easingthemes/ssh-deploy@v2.1.4
env:
SOURCE: "coverage"
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
REMOTE_HOST: ${{ secrets.SSH_HOST }}
REMOTE_USER: ${{ secrets.SSH_USER }}
TARGET: ${{ secrets.COVERAGE_DIR }}