Skip to content

Merge pull request #78 from kana-rus/update_documents #577

Merge pull request #78 from kana-rus/update_documents

Merge pull request #78 from kana-rus/update_documents #577

Workflow file for this run

name: test
on:
pull_request:
push:
branches:
- main
jobs:
Test:
runs-on: ubuntu-latest
strategy:
matrix:
rt: ['tokio', 'async-std']
toolchain: ['stable', 'nightly']
custom-header: [true, false]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- name: Run ohkami's doc tests
if: matrix.rt == 'tokio'
run: cargo test --doc --features rt_${{ matrix.rt }},DEBUG${{ matrix.custom-header && ',custom-header' || '' }}
- name: Run ohkami's lib tests
run: cargo test --lib --features rt_${{ matrix.rt }},DEBUG${{ matrix.custom-header && ',custom-header' || '' }}
- name: Run ohkami's lib tests without default features except fot `utils`
run: cargo test --lib --no-default-features --features utils,rt_${{ matrix.rt }},DEBUG${{ matrix.custom-header && ',custom-header' || '' }}
- name: Run ohkami's lib tests without default features except fot `testing`
run: cargo test --lib --no-default-features --features testing,rt_${{ matrix.rt }},DEBUG${{ matrix.custom-header && ',custom-header' || '' }}
- name: Run ohkami's lib tests without default features
run: cargo test --lib --no-default-features --features rt_${{ matrix.rt }},DEBUG${{ matrix.custom-header && ',custom-header' || '' }}
- name: Run ohkami's benchmark
if: matrix.toolchain == 'nightly'
working-directory: benches
run: cargo bench
- name: Cache cargo tools
id: cache_cargo_tools
uses: actions/cache@v3
with:
key: ${{ runner.os }}-cargo-install
path: ~/.cargo/bin
- name: Install cargo tools
if: ${{ steps.cache_cargo_tools.outputs.cache-hit != 'true' }}
run: |
cargo install sqlx-cli --no-default-features --features native-tls,postgres
- name: Run tests of examples
working-directory: examples
run: |
docker-compose -f ./realworld/docker-compose.yml up -d
cd ./realworld && sqlx migrate run
cargo test