-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.4 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
name: Test
on:
push:
branches: ["main", "test"]
pull_request:
branches: ["main", "test"]
schedule:
# Run every Monday at 00:00 UTC
- cron: '0 0 * * 1'
jobs:
test:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v1
- name: Check version
run: deno -V
- name: Verify formatting
run: deno fmt --check
- name: Install Fresh
run: deno run -A https://deno.land/x/fresh/init.ts ./tests/work --force --twind --tailwind --vscode
- name: Move deno.json
run: mv ./tests/work/deno.json ./deno.json
- name: view deno.json
run: cat ./deno.json
- name: Start Database on Docker
run: cd docker && docker compose up -d && cd .. && sleep 10 && docker container ls
- name: Run tests
run: deno test --unstable --allow-read --allow-write --allow-env --allow-net --no-check --coverage=./coverage tests/basic_test.ts
- name: View coverage
run: |
# reference: https://github.com/jhechtf/code-coverage
deno install --allow-read --no-check -n code-coverage https://deno.land/x/code_coverage/cli.ts &&
deno coverage --exclude=tests/work/ --lcov --output=lcov.info ./coverage/ &&
code-coverage --file lcov.info