Skip to content

Merge pull request #36 from M0rfes/fix/updated-docs #1

Merge pull request #36 from M0rfes/fix/updated-docs

Merge pull request #36 from M0rfes/fix/updated-docs #1

name: Server test and code coverage
on:
push:
branches:
- master
jobs:
test:
name: test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nettuscheduler
ports:
- 5432:5432
env:
PORT: 5000
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/nettuscheduler
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
scheduler/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Generate code coverage
run: |
cd scheduler
# https://github.com/xd009642/tarpaulin/issues/756
cargo install cargo-tarpaulin --version 0.18.0-alpha3 || true
# run the migrations first
cargo install sqlx-cli --no-default-features --features postgres || true
(cd crates/infra && sqlx migrate run)
# cargo install cargo-tarpaulin
cargo tarpaulin --avoid-cfg-tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true