Skip to content

test

test #1419

Workflow file for this run

name: test
on:
push:
branches: [develop]
pull_request:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
required:
runs-on: ubuntu-latest
name: test (${{ matrix.toolchain }})
strategy:
matrix:
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: cargo test --locked
run: cargo test --locked --workspace -F reqwest,blocking,poem-openapi --all-targets
- name: cargo test --doc
run: cargo test --locked --workspace -F reqwest,blocking,poem-openapi --doc
integration:
runs-on: ubuntu-latest
name: integration (stable)
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.80.1"
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Nix
uses: cachix/install-nix-action@V27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Cachix
uses: cachix/cachix-action@v15
with:
name: sandkasten
skipPush: true
- name: install packages
run: nix profile install --profile pkgs .#packages.all
- name: integration tests
run: |
if [[ "$GITHUB_EVENT_NAME" = "schedule" ]] || [[ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]]; then
proptests=1024
else
proptests=16
fi
nix develop .#test --command bash -c "setup-nsjail && for i in {1..5}; do integration-tests $proptests && break; done"
- name: Upload to codecov.io
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}