Skip to content

chore(mysql): run tests in CI #21

chore(mysql): run tests in CI

chore(mysql): run tests in CI #21

Workflow file for this run

name: Test
on:
push:
branches: [ main ]
pull_request:
branches: '*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.nightly }}
strategy:
fail-fast: false
matrix:
toolchain: [ 'stable' ]
nightly: [false]
include:
- toolchain: 'nightly'
nightly: true
steps:
- uses: actions/checkout@v3
- name: Install toolchain
run: |
rustup update
rustup component add clippy rustfmt
rustup install ${{ matrix.toolchain }}
- name: Print rust tooling information
run: |
rustc --version
cargo --version --verbose
cargo clippy --version
cargo fmt --version
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: rust_${{ matrix.toolchain }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run test - sqlite | sqlx | runtime-async-std | macros
run: cargo test --features sqlite,sqlx,runtime-async-std,macros --all-targets --verbose
- name: Run test - sqlite | diesel | runtime-async-std | macros
run: cargo test --features sqlite,diesel,runtime-async-std,macros --all-targets --verbose
- name: Run test - sqlite | diesel
run: cargo test --features sqlite,diesel --all-targets --verbose
- name: Start containers for database tests
run: docker compose -f "docker-compose.yml" up -d
- name: Run test - mysql | diesel
run: cargo test --features mysql,diesel --all-targets --verbose
- name: Run test - mysql | sqlx | runtime-async-std
run: cargo test --features mysql,sqlx,runtime-async-std --all-targets --verbose
- name: Stop containers for database tests
if: always()
run: |
docker compose -f "docker-compose.yml" down --volumes
sudo rm -rf .data/{postgresql-15,mysql-8}
- name: Run doc tests
run: cargo test --features sqlite,sqlx,runtime-async-std,macros --doc --verbose
- name: Run clippy
run: cargo clippy --features sqlite,sqlx,runtime-async-std,macros