Skip to content

Commit

Permalink
initial commit. Testing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BenJourdan committed Oct 11, 2024
1 parent 356a785 commit 0b4c3d7
Show file tree
Hide file tree
Showing 10 changed files with 592 additions and 0 deletions.
343 changes: 343 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
# This file is autogenerated by maturin v1.7.4
# To update, run
#
# maturin generate-ci github
#
name: CI

on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
- runner: ubuntu-latest
target: s390x
- runner: ubuntu-latest
target: ppc64le
steps:
- uses: actions/checkout@v4

# Set up Python
- uses: actions/setup-python@v5
with:
python-version: 3.x

# Install dependencies
- name: Install linters, formatters, test tools, and docs tools
run: |
pip install ruff black pytest sphinx sphinx-rtd-theme
# Run Ruff for linting and import sorting
- name: Run Ruff (Python linter)
run: ruff check . --fix

# Run Black to ensure code formatting (non-fix mode)
- name: Run Black (Python formatter check)
run: black --check .

# Run Pytest to ensure Python tests pass
- name: Run Python tests with pytest
run: pytest

# Set up Rust toolchain
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

# Run Rust tests
- name: Run Rust tests
run: cargo test

# Build wheels using Maturin
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: auto

# Upload wheels as artifacts
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist

# Build Sphinx Documentation
- name: Build Sphinx Documentation
run: |
cd docs
make html
# Upload Documentation as an Artifact
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: sphinx-docs
path: docs/_build/html/

musllinux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
steps:
- uses: actions/checkout@v4

# Set up Python
- uses: actions/setup-python@v5
with:
python-version: 3.x

# Install dependencies
- name: Install linters, formatters, test tools, and docs tools
run: |
pip install ruff black pytest sphinx sphinx-rtd-theme
# Run Ruff for linting and import sorting
- name: Run Ruff (Python linter)
run: ruff check . --fix

# Run Black to ensure code formatting (non-fix mode)
- name: Run Black (Python formatter check)
run: black --check .

# Run Pytest to ensure Python tests pass
- name: Run Python tests with pytest
run: pytest

# Set up Rust toolchain
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

# Run Rust tests
- name: Run Rust tests
run: cargo test

# Build wheels using Maturin
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: musllinux_1_2

# Upload wheels as artifacts
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist

# Build Sphinx Documentation
- name: Build Sphinx Documentation
run: |
cd docs
make html
# Upload Documentation as an Artifact
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: sphinx-docs
path: docs/_build/html/

windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
steps:
- uses: actions/checkout@v4

# Set up Python
- uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: ${{ matrix.platform.target }}

# Install dependencies
- name: Install linters, formatters, test tools, and docs tools
run: |
pip install ruff black pytest sphinx sphinx-rtd-theme
# Run Ruff for linting and import sorting
- name: Run Ruff (Python linter)
run: ruff check . --fix

# Run Black to ensure code formatting (non-fix mode)
- name: Run Black (Python formatter check)
run: black --check .

# Run Pytest to ensure Python tests pass
- name: Run Python tests with pytest
run: pytest

# Set up Rust toolchain
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

# Run Rust tests
- name: Run Rust tests
run: cargo test

# Build wheels using Maturin
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'

# Upload wheels as artifacts
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist

# Build Sphinx Documentation
- name: Build Sphinx Documentation
run: |
cd docs
make html
# Upload Documentation as an Artifact
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: sphinx-docs
path: docs/_build/html/

macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-12
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4

# Set up Python
- uses: actions/setup-python@v5
with:
python-version: 3.x

# Install dependencies
- name: Install linters, formatters, test tools, and docs tools
run: |
pip install ruff black pytest sphinx sphinx-rtd-theme
# Run Ruff for linting and import sorting
- name: Run Ruff (Python linter)
run: ruff check . --fix

# Run Black to ensure code formatting (non-fix mode)
- name: Run Black (Python formatter check)
run: black --check .

# Run Pytest to ensure Python tests pass
- name: Run Python tests with pytest
run: pytest

# Set up Rust toolchain
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

# Run Rust tests
- name: Run Rust tests
run: cargo test

# Build wheels using Maturin
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'

# Upload wheels as artifacts
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist

# Build Sphinx Documentation
- name: Build Sphinx Documentation
run: |
cd docs
make html
# Upload Documentation as an Artifact
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: sphinx-docs
path: docs/_build/html/

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist


Loading

0 comments on commit 0b4c3d7

Please sign in to comment.