Skip to content

CI

CI #558

Workflow file for this run

jobs:
bump:
if: "github.event_name == 'release' && github.event.action == 'created'"
name: Bump minor version
needs:
- lint
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
with:
ref: master
- name: Setup python 3.10
uses: "actions/setup-python@v3"
with:
python-version: '3.10'
- name: Install Rust
uses: "actions-rs/toolchain@v1"
with:
override: 'true'
toolchain: stable
- name: Install dependencies
run: "python -m pip install --upgrade pip\ncargo install cargo-bump\npython -m pip install poetry\ntouch Cargo.toml.orig\npython -m poetry install"
- name: Bump and push
run: "cargo bump patch\npoetry version patch\ngit config user.name github-actions\ngit config user.email [email protected]\ngit add Cargo.toml pyproject.toml\ngit commit -m \"Bump version (automatic commit)\"\ngit push"
lint:
name: Lint check
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- name: Install dhall
uses: "dhall-lang/setup-dhall@v4"
with:
version: '1.41.1'
- if: "github.event.name != 'pull_request'"
name: Check github actions workflow
run: "dhall lint .github/workflows/*.dhall\nyaml-to-dhall ./.github/workflows/schema.dhall < .github/workflows/ci.yml > expected.dhall\ndhall diff ./expected.dhall ./.github/workflows/ci.dhall"
- name: Setup python 3.10
uses: "actions/setup-python@v3"
with:
python-version: '3.10'
- name: Install dependencies
run: "python -m pip install --upgrade pip\npython -m pip install black isort autoflake"
- name: Check lint
run: "isort . --check --diff\nblack . --check"
linuxBuild:
container: quay.io/pypa/manylinux_2_24_x86_64
name: Build/test/publish Linux
needs:
- lint
runs-on: ubuntu-latest
steps:
- name: Install Rust
uses: "actions-rs/toolchain@v1"
with:
override: 'true'
toolchain: stable
- uses: "actions/checkout@v2"
- name: Install dependencies
run: "python${{ matrix.python-version }} -m pip install --upgrade pip\npython${{ matrix.python-version }} -m pip install poetry\ntouch Cargo.toml.orig\npython${{ matrix.python-version }} -m poetry install"
- if: "!(github.event_name == 'release' && github.event.action == 'created')"
name: Build and test python package
run: "python${{ matrix.python-version }} -m poetry run maturin build --strip --interpreter python${{ matrix.python-version }}\npython${{ matrix.python-version }} -m poetry run maturin develop\npython${{ matrix.python-version }} -m poetry run pytest tests"
- if: "github.event_name == 'release' && github.event.action == 'created'"
name: "Build and test python package (Release)"
run: "python${{ matrix.python-version }} -m poetry run maturin build --release --strip --interpreter python${{ matrix.python-version }}\npython${{ matrix.python-version }} -m poetry run maturin develop\npython${{ matrix.python-version }} -m poetry run pytest tests"
- name: Install wheels
run: "python${{ matrix.python-version }} -m pip install target/wheels/dhall*manylinux*.whl"
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'created'"
name: Release
uses: "softprops/action-gh-release@v1"
with:
files: "target/wheels/dhall*.whl"
- env:
MATURIN_PASSWORD: "${{ secrets.PYPI }}"
if: "startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'created'"
name: PyPI publish
run: "python${{ matrix.python-version }} -m poetry run maturin publish --no-sdist --username __token__ --interpreter python${{ matrix.python-version }}"
strategy:
fail-fast: true
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
macBuild:
name: Build/test/publish Mac
needs:
- lint
runs-on: macos-latest
steps:
- name: "Setup python ${{ matrix.python-version }}"
uses: "actions/setup-python@v3"
with:
python-version: "${{ matrix.python-version }}"
- name: Install Rust
uses: "actions-rs/toolchain@v1"
with:
override: 'true'
toolchain: stable
- uses: "actions/checkout@v2"
- name: Install dependencies
run: "python -m pip install --upgrade pip\npython -m pip install poetry\ntouch Cargo.toml.orig\npython -m poetry install"
- if: "!(github.event_name == 'release' && github.event.action == 'created')"
name: Build and test python package
run: "python -m poetry run maturin build --strip --interpreter python${{ matrix.python-version }}\npython -m poetry run maturin develop\npython -m poetry run pytest tests"
- if: "github.event_name == 'release' && github.event.action == 'created'"
name: "Build and test python package (Release)"
run: "python -m poetry run maturin build --release --strip --interpreter python${{ matrix.python-version }}\npython -m poetry run maturin develop\npython -m poetry run pytest tests"
- name: Install wheels
run: "python -m pip install target/wheels/dhall*.whl"
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'created'"
name: Release
uses: "softprops/action-gh-release@v1"
with:
files: "target/wheels/dhall*.whl"
- env:
MATURIN_PASSWORD: "${{ secrets.PYPI }}"
if: "startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'created'"
name: PyPI publish
run: "python -m poetry run maturin publish --no-sdist --username __token__ --interpreter python${{ matrix.python-version }}"
strategy:
fail-fast: true
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
windowsBuild:
name: Build/test/publish Windows
needs:
- lint
runs-on: windows-latest
steps:
- name: Install Rust
uses: "actions-rs/toolchain@v1"
with:
override: 'true'
toolchain: stable
- uses: "actions/checkout@v2"
- name: Install dependencies
run: "python -m pip install --upgrade pip\npython -m pip install poetry\ntouch Cargo.toml.orig\npython -m poetry install"
- if: "!(github.event_name == 'release' && github.event.action == 'created')"
name: Build and test python package
run: "python -m poetry run maturin build --strip\npython -m poetry run maturin develop\npython -m poetry run pytest tests"
- if: "github.event_name == 'release' && github.event.action == 'created'"
name: "Build and test python package (Release)"
run: "python -m poetry run maturin build --release --strip\npython -m poetry run maturin develop\npython -m poetry run pytest tests"
- name: Install wheels
run: "python -m pip install --find-links=target\\wheels dhall"
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'created'"
name: Release
uses: "softprops/action-gh-release@v1"
with:
files: "target/wheels/dhall*.whl"
- env:
MATURIN_PASSWORD: "${{ secrets.PYPI }}"
if: "startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'created'"
name: PyPI publish
run: python -m poetry run maturin publish --no-sdist --username __token__
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
release:
types:
- created
schedule:
- cron: "20 23 * * 6"