Skip to content

CI

CI #102

Workflow file for this run

name: CI
on:
schedule:
- cron: "0 0 1 * *" # Run every month
# This way, we can make sure code doesn't break via external dependencies
push:
env:
POETRY_VERSION: 1.3.0
jobs:
python-tests:
strategy:
matrix:
python-version:
- 3.8
- 3.9
- "3.10"
- "3.11"
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./src/python
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (UNIX)
if: runner.os != 'Windows'
run: |
python3 -m pip install poetry==$POETRY_VERSION poethepoet
poetry install
poetry install # Second time to install the project
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install poetry==$env:POETRY_VERSION poethepoet
poetry install
poetry install # Second time to install the project
- name: Run test suite
run: poe ci
- name: Upload to CodeCov
uses: codecov/codecov-action@v3
python-docs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/python
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip poetry==$POETRY_VERSION poethepoet
poetry install
poetry install # Second time to install the project
- name: Build docs
run: poe docs
python-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/python
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3
- name: Install Poetry $POETRY_VERSION
run: |
curl -sSL https://install.python-poetry.org | POETRY_HOME="$HOME/.local" python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Build project
run: poetry build
rust-lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/rust
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy
toolchain: stable
- name: Lint with clippy
run: cargo clippy
- name: Lint with fmt
run: cargo fmt --check
rust-test:
# TODO: Do we need multiple OSs?
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/rust
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: llvm-tools-preview
- name: Install grcov
run: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
- name: Test project
run: cargo test
env:
RUSTFLAGS: "-Cinstrument-coverage"
- name: Generate coverage files
run: ./grcov . --source-dir . --binary-path ./target/debug/ --output-type lcov --branch --ignore-not-existing -o ./lcov.info
- name: Upload to CodeCov
uses: codecov/codecov-action@v3