Skip to content

build: run python tests in GitHub Actions #553

build: run python tests in GitHub Actions

build: run python tests in GitHub Actions #553

Workflow file for this run

name: CI
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --release --no-fail-fast
pumpkin-py:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
name: linux
- runner: ubuntu-latest
target: x86
name: linux
- runner: ubuntu-latest
target: aarch64
name: linux
- runner: ubuntu-latest
target: armv7
name: linux
- runner: ubuntu-latest
target: s390x
name: linux
- runner: ubuntu-latest
target: ppc64le
name: linux
- runner: windows-latest
target: x64
name: windows
- runner: windows-latest
target: x86
name: windows
- runner: macos-12
target: x86_64
name: macos
- runner: macos-14
target: aarch64
name: macos
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install pytest
run: pip install pytest
- name: Install pumpkin-py
run: pip install -e .
working-directory: pumpkin-py
- name: Run tests
run: pytest
working-directory: pumpkin-py
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
- run: cargo doc --no-deps
code_style:
name: Code Style and Lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- run: cargo +nightly fmt --check
- run: cargo +nightly clippy --all-targets
licenses:
name: Dependency Licensing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
- run: ./scripts/deny.sh --ci