Update dependabot.yml (#27) #47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
jobs: | |
clippy: | |
name: Clippy check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: clippy | |
override: true | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-features | |
name: Clippy Output | |
fmt: | |
name: Rustfmt check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
linux-build: | |
name: Linux -> build & test | |
runs-on: ubuntu-latest | |
needs: [clippy, fmt] | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x86_64, i686, aarch64, armv7, s390x, ppc64le] | |
# include: | |
# - target: aarch64 | |
# container: messense/manylinux_2_24-cross:aarch64 | |
# - target: armv7 | |
# container: messense/manylinux_2_24-cross:armv7 | |
# - target: s390x | |
# container: messense/manylinux_2_24-cross:ppc64le | |
# - target: ppc64le | |
# container: messense/manylinux_2_24-cross:s390x | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter 3.7 3.8 3.9 3.10 3.11 | |
manylinux: 'auto' | |
rust-toolchain: stable | |
- run: ls -lh dist/ | |
- name: Install & test (x86_64) | |
if: ${{ startsWith(matrix.target, 'x86_64') }} | |
shell: bash | |
run: | | |
rm -r bioforma | |
pip install pytest | |
pip install bioforma --no-index --no-deps --find-links dist --force-reinstall | |
pytest | |
- name: Install & test (aarch64, armv7, s390x, ppc64le) | |
if: ${{ !startsWith(matrix.target, 'x86_64') && !startsWith(matrix.target, 'i686') }} | |
uses: uraimo/[email protected] | |
with: | |
arch: ${{ matrix.target }} | |
distro: ubuntu22.04 | |
githubToken: ${{ github.token }} | |
install: | | |
apt-get update | |
apt-get install -y --no-install-recommends python3 python3-pip | |
run: | | |
rm -r bioforma | |
python3 -m pip install -U pip pytest | |
python3 -m pip install bioforma --no-index --no-deps --find-links dist --force-reinstall | |
pytest | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
if: "success() && startsWith(github.ref, 'refs/tags/')" | |
with: | |
name: wheels | |
path: dist | |
windows-build: | |
name: Windows -> build & test | |
runs-on: windows-latest | |
needs: [clippy, fmt] | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x64, x86] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
architecture: ${{ matrix.target }} | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter 3.7 3.8 3.9 3.10 3.11 | |
manylinux: 'auto' | |
rust-toolchain: stable | |
- run: dir dist/ | |
- name: Install & test | |
shell: bash | |
run: | | |
rm -r bioforma | |
pip install pytest | |
pip install bioforma --no-index --no-deps --find-links dist --force-reinstall | |
pytest | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
if: "success() && startsWith(github.ref, 'refs/tags/')" | |
with: | |
name: wheels | |
path: dist | |
macos-build: | |
name: MacOS -> build & test | |
runs-on: macos-latest | |
needs: [clippy, fmt] | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter 3.7 3.8 3.9 3.10 3.11 | |
manylinux: 'auto' | |
rust-toolchain: stable | |
- run: ls -lh dist/ | |
- name: Install & test (x86_64) | |
if: ${{ startsWith(matrix.target, 'x86_64') }} | |
shell: bash | |
run: | | |
rm -r bioforma | |
pip install pytest | |
pip install bioforma --no-index --no-deps --find-links dist --force-reinstall | |
pytest | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
if: "success() && startsWith(github.ref, 'refs/tags/')" | |
with: | |
name: wheels | |
path: dist | |
build-sdist: | |
name: Build sdist | |
runs-on: ubuntu-latest | |
needs: [linux-build, windows-build, macos-build] | |
if: "success() && startsWith(github.ref, 'refs/tags/')" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: sdist | |
args: --out dist | |
rust-toolchain: stable | |
- run: ls -lh dist/ | |
- name: Upload sdist | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [linux-build, windows-build, macos-build, build-sdist] | |
if: "success() && startsWith(github.ref, 'refs/tags/')" | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --skip-existing * | |
- name: Make a github release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/* | |
# prerelease: ${{ contains(github.ref, 'a') || contains(github.ref, 'b') }} |