Bump archive from 3.3.6 to 3.3.8 in /frontend #179
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: Backend | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
defaults: | |
run: | |
working-directory: ./backend | |
jobs: | |
cargo-fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt --all -- --check | |
doc: | |
name: Rustdoc | |
runs-on: ubuntu-latest | |
env: | |
SQLX_OFFLINE: true | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rust-docs | |
- uses: Swatinem/rust-cache@v2 | |
- env: | |
RUSTDOCFLAGS: "-D missing_docs -D rustdoc::missing_doc_code_examples" | |
run: cargo doc --workspace --all-features --no-deps --document-private-items | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
env: | |
SQLX_OFFLINE: true | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy -- -D warnings | |
cargo-test: | |
name: Test | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: postgres | |
ports: | |
- 5432:5432 | |
redis: | |
image: redis:6 | |
ports: | |
- 6379:6379 | |
env: | |
SQLX_VERSION: 0.6.0 | |
SQLX_FEATURES: postgres,native-tls | |
RUST_BACKTRACE: 1 | |
RUST_LOG: info | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/cache-cargo-install-action@v1 | |
with: | |
tool: sqlx-cli | |
- uses: taiki-e/install-action@nextest | |
- name: Migrate database | |
working-directory: ./backend | |
run: | | |
sudo apt-get install libpq-dev -y | |
SKIP_DOCKER=true ./scripts/init_db.sh | |
- name: Build and archive tests | |
run: cargo nextest run | |
tarpaulin-coverage: | |
name: Code coverage | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: postgres | |
ports: | |
- 5432:5432 | |
redis: | |
image: redis:6 | |
ports: | |
- 6379:6379 | |
env: | |
SQLX_VERSION: 0.6.0 | |
SQLX_FEATURES: postgres,native-tls | |
RUST_BACKTRACE: 1 | |
RUST_LOG: info | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/cache-cargo-install-action@v1 | |
with: | |
tool: sqlx-cli | |
- name: Migrate database | |
working-directory: ./backend | |
run: | | |
sudo apt-get install libpq-dev -y | |
SKIP_DOCKER=true ./scripts/init_db.sh | |
- uses: taiki-e/install-action@cargo-llvm-cov | |
- uses: taiki-e/install-action@nextest | |
- name: Generate code coverage | |
run: cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: lcov.info | |
fail_ci_if_error: true |