-
Notifications
You must be signed in to change notification settings - Fork 161
56 lines (55 loc) · 1.75 KB
/
lint-and-test.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
name: Lint And Test
on:
pull_request:
branches: [master]
push:
branches: [master]
jobs:
verify_lint:
name: Verify lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Use node 16
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
# Install deps from lockfile
run: npm ci
# Run lint
- name: Lint
run: npm run lint
run_tests_and_push_to_codecov:
# Name with matrix eval
runs-on: ubuntu-latest
needs: verify_lint
strategy:
matrix:
# We verify compatibility for current and previous LTS
node_version: [16, 18]
name: "[ Node ${{ matrix.node_version }} ] Run tests and push to codecov"
env:
NODE_VERSION: ${{ matrix.node_version }}
steps:
- uses: actions/checkout@v3
with:
# Fetch all history for all tags and branches
fetch-depth: 0
- name: Build the stack
run: docker-compose up -d
- name: Build testing container
run: docker build -t tests:${{ github.sha }} --build-arg SET_NODE_VERSION=$NODE_VERSION .
- name: Invoke testing container
run: docker run --network container:vault
-e VAULT_ADDR=$VAULT_ADDR
-v $PWD/coverage:/app/coverage tests:${{ github.sha }} "cd /app && npm run coverage"
env:
VAULT_ADDR: http://vault:8200
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # tag: 3.1.4
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: NODE_VERSION # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)