Skip to content

test

test #395

Workflow file for this run

name: test
on:
push:
branches: [develop]
pull_request:
merge_group:
permissions:
contents: read
jobs:
unit:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo test --no-fail-fast --all-features --bins --lib
- run: cargo test --no-fail-fast --all-features --doc
postgres:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: echo 'database.url = "postgres://academy@localhost/academy"' > config.extra.toml
- run: cargo test -p academy_persistence_postgres --no-fail-fast --all-features --test '*'
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.extra.toml:${{ github.workspace }}/config.dev.toml
RUST_TEST_THREADS: 1
services:
postgres:
image: postgres:17-alpine
ports:
- '5432:5432'
env:
POSTGRES_USER: academy
POSTGRES_DB: academy
POSTGRES_HOST_AUTH_METHOD: trust
valkey:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: echo 'cache.url = "redis://localhost"' > config.extra.toml
- run: cargo test -p academy_cache_valkey --no-fail-fast --all-features --test '*'
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.extra.toml:${{ github.workspace }}/config.dev.toml
RUST_TEST_THREADS: 1
services:
valkey:
image: valkey/valkey:8.0-alpine
ports:
- '6379:6379'
email:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: echo 'email.smtp_url = "smtp://academy:academy@localhost:25"' > config.extra.toml
- run: cargo test -p academy_email_impl --no-fail-fast --all-features --test '*'
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.extra.toml:${{ github.workspace }}/config.dev.toml
SMTP4DEV_URL: http://localhost:80
RUST_TEST_THREADS: 1
services:
smtp4dev:
image: rnwood/smtp4dev:3.6.1
env:
ServerOptions__AuthenticationRequired: "true"
ServerOptions__Users__0__Username: academy
ServerOptions__Users__0__Password: academy
ports:
- '25:25'
- '80:80'
extern:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo build --bin academy-testing
- name: test recaptcha
run: |
cargo run --bin academy-testing -- recaptcha &
while ! curl -s http://127.0.0.1:8001; do sleep .1; done
cargo test -p academy_extern_impl --no-fail-fast --all-features --test recaptcha
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.dev.toml
- name: test oauth2
run: |
cargo run --bin academy-testing -- oauth2 &
while ! curl -s http://127.0.0.1:8002; do sleep .1; done
cargo test -p academy_extern_impl --no-fail-fast --all-features --test oauth2
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.dev.toml
- name: test vat
run: |
cargo run --bin academy-testing -- vat &
while ! curl -s http://127.0.0.1:8003; do sleep .1; done
cargo test -p academy_extern_impl --no-fail-fast --all-features --test vat
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.dev.toml