Skip to content

Test

Test #74

Workflow file for this run

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 --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