Skip to content

Workflow file for this run

name: Nelsie Test CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check Rust formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
# - name: Lint Rust
# uses: actions-rs/cargo@v1
# with:
# command: clippy
# args: --all -- -D warnings
- name: Test Rust
uses: actions-rs/cargo@v1
with:
command: test
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install -r scripts/requirements-dev.txt
- name: Lint Python
run: python -m ruff check
- name: Check Python formatting
run: python -m ruff format --check
- name: Build package
uses: PyO3/maturin-action@v1
with:
command: build --out wheels
- name: Install package
run: |
python -m pip install wheels/*.whl
- name: Run pytest
id: python_test
run: |
python -m pytest tests
- name: Archive test artifacts
if: always() && steps.python_test.outcome == 'failure'
run: tar -cvf artifacts.tar /tmp/pytest-*
- name: Upload test artifacts
uses: actions/upload-artifact@v2
if: always() && steps.python_test.outcome == 'failure'
with:
name: pytest artifacts
path: artifacts.tar
# windows:
# runs-on: windows-latest
# strategy:
# matrix:
# target: [x64, x86]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# architecture: ${{ matrix.target }}
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.target }}
# args: --release --out dist
# sccache: 'true'
# - name: Upload wheels
# uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: dist
# macos:
# runs-on: macos-latest
# strategy:
# matrix:
# target: [x86_64, aarch64]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.target }}
# args: --release --out dist
# sccache: 'true'
# - name: Upload wheels
# uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: dist