-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (79 loc) · 2.03 KB
/
build-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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build and Test
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
DENO_DIR: ./.cache
DENO_VER: "1.37.2"
jobs:
caching:
name: "Cache Updates"
runs-on: ubuntu-latest
steps:
- name: "Check out code"
uses: actions/checkout@v3
- name: "Setup cache"
uses: actions/cache@v3
with:
path: ${{ env.DENO_DIR }}
key: deno-${{ hashFiles('deno.lock' )}}
- name: "Setup Deno"
uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VER }}
- name: "Update cache"
run: |
deno cache --reload \
deps/src/all.ts deps/test/all.ts
coding-checks:
name: "Coding Checks"
runs-on: ubuntu-latest
needs:
- caching
steps:
- name: "Check out code"
uses: actions/checkout@v3
- name: "Setup cache"
uses: actions/cache@v3
with:
path: ${{ env.DENO_DIR }}
key: deno-${{ hashFiles('deno.lock') }}
- name: "Setup Deno"
uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VER }}
- name: "Lint check"
run: deno lint
- name: "Format check"
run: deno fmt --check
unit-test:
name: "Testing"
runs-on: ubuntu-latest
needs:
- caching
steps:
- name: "Check out code"
uses: actions/checkout@v3
- name: "Setup cache"
uses: actions/cache@v3
with:
path: ${{ env.DENO_DIR }}
key: deno-${{ hashFiles('deno.lock') }}
- name: "Setup Deno"
uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VER }}
- name: "Run unit tests"
run: deno test --coverage=coverage/profile
- name: "Generate coverage reports"
run: |
deno coverage \
--exclude=test \
--lcov --output=coverage/lcov \
coverage/profile
- name: "Report coverage"
uses: codecov/codecov-action@v3
with:
files: coverage/lcov