-
-
Notifications
You must be signed in to change notification settings - Fork 130
64 lines (64 loc) · 1.91 KB
/
api-push.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
name: Test on Push for API
on:
push:
paths:
- 'apps/api/*'
jobs:
lint-test:
name: Lint and Test
runs-on: ubuntu-latest
steps:
- name: Set up Node.js 13.x
uses: actions/setup-node@v2
with:
node-version: 13.x
# registry-url: <registry url>
id: node
- name: Setup Tools
run: |
# npm install -g lerna
npm install -g @angular/cli
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check out Code
uses: actions/checkout@v2
- name: Cache node modules
id: yarn-cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Lint
run: yarn ng lint api
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Unit Test
run: yarn ng test api
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: Integration Test
# run: yarn ng e2e api
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
-F unittests
-n codecov-ngx-api
-f ./coverage/apps/api/coverage-final.json
-B "${GITHUB_REF//refs\/heads\//}"
-T "${GITHUB_REF//refs\/tags\//}"
-C "${GITHUB_SHA}"
-Z || echo 'Codecov upload failed'
env:
CI: true
CODECOV_ENV: github-action
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_PR: ${{ github.event.after }}
CODECOV_SHA: ${{ github.sha }}