-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (106 loc) · 3.09 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on:
push:
branches:
- dev
- main
tags:
- '*'
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash -leo pipefail {0}
permissions:
contents: 'read'
jobs:
testing:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: ci
environment-file: environment.yaml
create-args: >-
python==${{ matrix.python-version }}
init-shell: bash
cache-environment: true
post-cleanup: 'all'
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release
- name: Rust Tests
run: RUST_BACKTRACE=1 cargo test --release
- name: Build wheels
run: maturin develop --release --manifest-path pyargus/Cargo.toml
- name: Python Tests
run: RUST_BACKTRACE=1 pytest pyargus --hypothesis-explain
linting:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ['3.10']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: ci
environment-file: environment.yaml
create-args: >-
python==${{ matrix.python-version }}
init-shell: bash
cache-environment: true
post-cleanup: 'all'
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: "clippy, rustfmt"
- name: Rust lints
run: |
cargo +nightly fmt --all --check
cargo +nightly check --workspace
cargo +nightly clippy --workspace
- name: Build Python package
run: maturin develop --release --manifest-path pyargus/Cargo.toml
- name: Python checks
working-directory: pyargus
run: |
black .
isort .
flake8
ruff check .
mypy .
docs:
name: Documentation
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: ci
environment-file: environment.yaml
init-shell: bash
cache-environment: true
post-cleanup: 'all'
- name: Build Python package
run: maturin develop --release --manifest-path pyargus/Cargo.toml
- name: Build HTML docs
run: |
sphinx-multiversion docs _site -b html
cp ./docs/_templates/index-redirect.html _site/index.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _site/