fix(ci): fixes gh action #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: [ main, project-init ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup test database | |
run: | | |
cd docker && docker-compose up -d && cd .. | |
docker ps -a | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Run doc tests | |
run: cargo test --doc --verbose | |
test: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup test database | |
run: | | |
cd docker && docker-compose up -d && cd .. | |
docker ps -a | |
- name: Setup | |
run: | | |
cargo install cargo-tarpaulin | |
- name: Install Nightly | |
run: | | |
rustup toolchain install nightly | |
- name: Generate code coverage | |
run: | | |
cargo tarpaulin --verbose --all-features --workspace --timeout 120 --run-types Tests --run-types Doctests --out Xml | |
- name: Coverage upload | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
fail_ci_if_error: true |