Fix CI #136
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
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
name: Tests | |
# TODO: test the python package with cross compilation settings | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: [stable, 1.64, 1.61] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- name: Change dependency versions | |
run: git apply .github/workflows/change_version.patch | |
- name: Remove dev-deps for MSRV | |
run: git apply .github/workflows/remove_dev_deps.patch | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --all-features --tests | |
test: | |
name: Test | |
strategy: | |
matrix: | |
bits: [16, 32, 64] | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14 | |
env: | |
POSTGRES_PASSWORD: '' | |
POSTGRES_HOST_AUTH_METHOD: 'trust' | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
env: | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: -D warnings --cfg force_bits="${{ matrix.bits }}$" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all-features --workspace --exclude benchmark --no-fail-fast | |
test-x86: | |
name: Test x86 | |
runs-on: ubuntu-latest | |
env: | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable-i686-unknown-linux-gnu | |
override: true | |
- run: | | |
sudo apt update | |
sudo apt install gcc-multilib | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --workspace --exclude benchmark --exclude dashu-python | |
test-x86_64: | |
name: Test x86_64 | |
runs-on: ubuntu-latest | |
env: | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable-x86_64-unknown-linux-gnu | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --workspace --exclude benchmark | |
test-no-std: | |
name: Test no-std | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --no-default-features --features rand --workspace --exclude benchmark --exclude dashu-python | |
build-benchmark: | |
name: Build benchmark | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: -p benchmark --features gmp | |
build-aarch64: | |
name: Build aarch64 | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
target: aarch64-unknown-linux-gnu | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --target aarch64-unknown-linux-gnu --all-features --workspace --exclude benchmark --exclude dashu-python | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: clippy | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all-features --all-targets --workspace --exclude benchmark -- -D warnings |