ci: skip test before shuttle deployment #99
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: development | |
env: | |
FIXED_RUST_VERSION: 1.74.0 | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- 1.74.0 | |
- stable | |
- beta | |
- nightly | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
profile: minimal | |
- name: Release build | |
run: cargo build --release | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- 1.74.0 | |
- stable | |
- beta | |
- nightly | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
profile: minimal | |
components: rustfmt, clippy | |
- name: Format | |
run: cargo fmt --all -- --check | |
- name: Clippy | |
run: cargo clippy --all-targets --all-features -- -D warnings | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- 1.74.0 | |
- stable | |
- beta | |
- nightly | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
profile: minimal | |
- name: Unit Test | |
run: cargo test --lib | |
- name: Start MongoDB | |
uses: supercharge/[email protected] | |
- name: Integration Test | |
run: cargo test --test '*' | |
env: | |
RUST_TEST_THREADS: 1 | |
MONGODB_URI: "mongodb://localhost:27017/" | |
MONGODB_DATABASE_NAME: "test" | |
coverage: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ env.FIXED_RUST_VERSION }} | |
profile: minimal | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Install rust-covfix | |
run: | | |
curl -L https://github.com/Kogia-sima/rust-covfix/releases/latest/download/rust-covfix-linux-x86_64.tar.xz |tar Jxf - | |
mv rust-covfix-linux-x86_64/rust-covfix ./ | |
- name: Start MongoDB | |
uses: supercharge/[email protected] | |
- name: Generate and fix code coverage | |
run: | | |
cargo llvm-cov --ignore-filename-regex "main|repository" --lcov --output-path lcov.info | |
./rust-covfix lcov.info -o lcov.info | |
env: | |
RUST_TEST_THREADS: 1 | |
MONGODB_URI: "mongodb://localhost:27017/" | |
MONGODB_DATABASE_NAME: "test" | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./lcov.info | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |