⬆ Bump the python-packages group with 2 updates #61
Workflow file for this run
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '**' | |
pull_request: {} | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test-linux: | |
name: test rust-${{ matrix.rust-version }} on linux | |
strategy: | |
fail-fast: false | |
matrix: | |
rust-version: [stable, nightly] | |
runs-on: ubuntu-latest | |
env: | |
RUNS_ON: ubuntu-latest | |
RUST_VERSION: ${{ matrix.rust-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust-version }} | |
- id: cache-rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: "v1-rust" | |
- run: cargo install rustfilt coverage-prepare cargo-careful | |
if: steps.cache-rust.outputs.cache-hit != 'true' | |
- run: rustup component add llvm-tools-preview | |
- name: Build | |
run: cargo build --verbose | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: lcov.info | |
test-macos: | |
name: test on ${{ matrix.runs-on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: [macos-latest] | |
runs-on: ${{ matrix.runs-on }} | |
env: | |
RUNS_ON: ${{ matrix.runs-on }} | |
RUST_VERSION: stable | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- id: cache-rust | |
uses: Swatinem/rust-cache@v2 | |
- run: cargo install rustfilt coverage-prepare | |
if: steps.cache-rust.outputs.cache-hit != 'true' | |
- run: rustup component add llvm-tools-preview | |
- name: Build | |
run: cargo build --verbose | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: lcov.info | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: cache rust | |
uses: Swatinem/rust-cache@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: pre-commit/action@v3.0.1 | |
with: | |
extra_args: --all-files --verbose | |
Docker: | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
contents: write | |
pull-requests: write | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2.2.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2.10.0 | |
- name: Build Docker Image | |
id: docker_build | |
uses: docker/build-push-action@v4.2.1 | |
with: | |
context: . | |
platforms: linux/amd64 | |
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks | |
check: | |
if: always() | |
needs: [test-linux, test-macos, lint, Docker] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
allowed-failures: coverage |