2020-08-11 21:32:59 +00:00
|
|
|
name: CI
|
2019-11-16 12:39:59 +00:00
|
|
|
|
2020-08-16 13:36:15 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-03-16 22:14:57 +00:00
|
|
|
- main
|
2020-08-16 13:36:15 +00:00
|
|
|
pull_request:
|
2022-04-17 03:28:21 +00:00
|
|
|
workflow_dispatch:
|
2019-11-16 12:39:59 +00:00
|
|
|
|
2022-03-15 12:47:39 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-09-01 19:59:28 +00:00
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
2019-11-16 12:39:59 +00:00
|
|
|
jobs:
|
2020-08-08 17:03:16 +00:00
|
|
|
fmt:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-06-02 06:32:51 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v3
|
2022-02-12 09:37:46 +00:00
|
|
|
- run: pip install nox
|
2020-08-08 17:03:16 +00:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2020-08-16 13:36:15 +00:00
|
|
|
profile: minimal
|
|
|
|
components: rustfmt
|
2020-08-08 17:03:16 +00:00
|
|
|
- name: Check python formatting (black)
|
2022-02-12 09:37:46 +00:00
|
|
|
run: nox -s fmt-py
|
2020-08-08 17:03:16 +00:00
|
|
|
- name: Check rust formatting (rustfmt)
|
2022-02-12 09:37:46 +00:00
|
|
|
run: nox -s fmt-rust
|
2020-08-08 17:03:16 +00:00
|
|
|
|
|
|
|
clippy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-06-02 06:32:51 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v3
|
2022-02-12 09:37:46 +00:00
|
|
|
- run: pip install nox
|
2020-08-08 17:03:16 +00:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2020-08-16 13:36:15 +00:00
|
|
|
profile: minimal
|
|
|
|
components: clippy
|
2022-02-12 09:37:46 +00:00
|
|
|
- run: nox -s clippy
|
2020-08-08 17:03:16 +00:00
|
|
|
|
2021-08-30 08:13:43 +00:00
|
|
|
check-target:
|
|
|
|
needs: [fmt]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2022-03-15 15:46:02 +00:00
|
|
|
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
|
|
|
|
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
|
2021-08-30 08:13:43 +00:00
|
|
|
matrix:
|
|
|
|
target: [powerpc64le-unknown-linux-gnu, s390x-unknown-linux-gnu, wasm32-wasi]
|
|
|
|
name: check-${{ matrix.target }}
|
|
|
|
steps:
|
2022-06-02 06:32:51 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-08-30 08:13:43 +00:00
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
profile: minimal
|
|
|
|
default: true
|
|
|
|
|
|
|
|
- name: Run cargo checks
|
|
|
|
run: |
|
|
|
|
set -x
|
2021-11-19 10:45:27 +00:00
|
|
|
VERSIONS=("3.7" "3.8" "3.9" "3.10")
|
2021-08-30 08:13:43 +00:00
|
|
|
for VERSION in ${VERSIONS[@]}; do
|
|
|
|
echo "version=$VERSION" > config.txt
|
2021-10-17 07:38:47 +00:00
|
|
|
echo "suppress_build_script_link_lines=true" >> config.txt
|
2021-10-24 07:02:21 +00:00
|
|
|
PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --no-default-features
|
|
|
|
PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --no-default-features --features "abi3"
|
2021-12-24 07:12:04 +00:00
|
|
|
PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --features full
|
|
|
|
PYO3_BUILD_CONFIG=$(pwd)/config.txt cargo check --all-targets --features "abi3 full"
|
2021-08-30 08:13:43 +00:00
|
|
|
done
|
|
|
|
|
2019-11-16 12:39:59 +00:00
|
|
|
build:
|
2020-08-08 17:03:16 +00:00
|
|
|
needs: [fmt] # don't wait for clippy as fails rarely and takes longer
|
2022-02-14 21:47:39 +00:00
|
|
|
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} rust-${{ matrix.rust }}
|
2020-03-24 05:59:03 +00:00
|
|
|
runs-on: ${{ matrix.platform.os }}
|
2019-11-16 12:39:59 +00:00
|
|
|
strategy:
|
2022-03-15 15:46:02 +00:00
|
|
|
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
|
|
|
|
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
|
2019-11-16 12:39:59 +00:00
|
|
|
matrix:
|
2020-08-16 13:36:15 +00:00
|
|
|
rust: [stable]
|
2022-02-05 00:22:09 +00:00
|
|
|
python-version: [
|
|
|
|
"3.7",
|
|
|
|
"3.8",
|
|
|
|
"3.9",
|
|
|
|
"3.10",
|
2022-06-08 07:09:42 +00:00
|
|
|
"3.11-dev",
|
2022-03-08 20:57:25 +00:00
|
|
|
"pypy-3.7",
|
2022-02-05 00:22:09 +00:00
|
|
|
"pypy-3.8",
|
2022-02-23 08:14:52 +00:00
|
|
|
"pypy-3.9"
|
2022-02-05 00:22:09 +00:00
|
|
|
]
|
2021-06-26 13:37:55 +00:00
|
|
|
platform:
|
|
|
|
[
|
|
|
|
{
|
|
|
|
os: "macos-latest",
|
|
|
|
python-architecture: "x64",
|
|
|
|
rust-target: "x86_64-apple-darwin",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
os: "ubuntu-latest",
|
|
|
|
python-architecture: "x64",
|
|
|
|
rust-target: "x86_64-unknown-linux-gnu",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
os: "windows-latest",
|
|
|
|
python-architecture: "x64",
|
|
|
|
rust-target: "x86_64-pc-windows-msvc",
|
|
|
|
},
|
|
|
|
]
|
2020-08-16 13:36:15 +00:00
|
|
|
include:
|
|
|
|
# Test minimal supported Rust version
|
2021-11-18 11:38:47 +00:00
|
|
|
- rust: 1.48.0
|
2021-10-24 10:21:23 +00:00
|
|
|
python-version: "3.10"
|
2021-06-26 13:37:55 +00:00
|
|
|
platform:
|
|
|
|
{
|
|
|
|
os: "ubuntu-latest",
|
|
|
|
python-architecture: "x64",
|
|
|
|
rust-target: "x86_64-unknown-linux-gnu",
|
|
|
|
}
|
2020-08-16 13:36:15 +00:00
|
|
|
msrv: "MSRV"
|
2020-08-07 00:50:11 +00:00
|
|
|
|
2022-02-14 20:31:59 +00:00
|
|
|
# Test the `nightly` feature
|
|
|
|
- rust: nightly
|
|
|
|
python-version: "3.10"
|
|
|
|
platform:
|
|
|
|
{
|
|
|
|
os: "ubuntu-latest",
|
|
|
|
python-architecture: "x64",
|
|
|
|
rust-target: "x86_64-unknown-linux-gnu",
|
|
|
|
}
|
|
|
|
extra_features: "nightly"
|
2022-03-15 15:00:43 +00:00
|
|
|
|
|
|
|
# Test 32-bit Windows only with the latest Python version
|
|
|
|
- rust: stable
|
|
|
|
python-version: "3.10"
|
|
|
|
platform:
|
|
|
|
{
|
|
|
|
os: "windows-latest",
|
|
|
|
python-architecture: "x86",
|
|
|
|
rust-target: "i686-pc-windows-msvc",
|
|
|
|
}
|
2019-11-16 12:39:59 +00:00
|
|
|
steps:
|
2022-06-02 06:32:51 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-08-07 00:50:11 +00:00
|
|
|
|
2019-12-28 11:36:20 +00:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2022-06-02 06:32:51 +00:00
|
|
|
uses: actions/setup-python@v3
|
2019-12-28 11:36:20 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2020-08-07 00:50:11 +00:00
|
|
|
architecture: ${{ matrix.platform.python-architecture }}
|
|
|
|
|
|
|
|
- name: Install Rust toolchain
|
2019-12-28 11:36:20 +00:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2020-08-16 13:36:15 +00:00
|
|
|
toolchain: ${{ matrix.rust }}
|
2020-08-07 00:50:11 +00:00
|
|
|
target: ${{ matrix.platform.rust-target }}
|
2020-08-16 13:36:15 +00:00
|
|
|
profile: minimal
|
2020-10-12 13:51:45 +00:00
|
|
|
default: true
|
2021-09-12 17:07:24 +00:00
|
|
|
# needed to correctly format errors, see #1865
|
|
|
|
components: rust-src
|
2020-08-07 00:50:11 +00:00
|
|
|
|
2021-12-18 09:03:34 +00:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
with:
|
|
|
|
key: cargo-${{ matrix.platform.python-architecture }}-${{ matrix.platform.os }}-${{ matrix.msrv }}
|
|
|
|
continue-on-error: true
|
|
|
|
|
2020-08-16 13:36:15 +00:00
|
|
|
- if: matrix.platform.os == 'ubuntu-latest'
|
|
|
|
name: Prepare LD_LIBRARY_PATH (Ubuntu only)
|
2020-10-12 13:51:45 +00:00
|
|
|
run: echo LD_LIBRARY_PATH=${pythonLocation}/lib >> $GITHUB_ENV
|
2020-08-07 00:50:11 +00:00
|
|
|
|
2021-03-24 22:29:00 +00:00
|
|
|
- if: matrix.msrv == 'MSRV'
|
|
|
|
name: Prepare minimal package versions (MSRV only)
|
2021-07-22 07:15:26 +00:00
|
|
|
run: |
|
2022-03-21 03:23:27 +00:00
|
|
|
set -x
|
2021-07-22 07:15:26 +00:00
|
|
|
cargo update -p indexmap --precise 1.6.2
|
2022-05-03 05:18:45 +00:00
|
|
|
cargo update -p hashbrown:0.12.1 --precise 0.9.1
|
2022-03-21 03:23:27 +00:00
|
|
|
PROJECTS=("." "examples/decorator" "examples/maturin-starter" "examples/setuptools-rust-starter" "examples/word-count")
|
|
|
|
for PROJ in ${PROJECTS[@]}; do
|
|
|
|
cargo update --manifest-path "$PROJ/Cargo.toml" -p parking_lot --precise 0.11.0
|
|
|
|
done
|
2021-03-24 22:29:00 +00:00
|
|
|
|
2020-12-17 03:00:48 +00:00
|
|
|
- name: Build docs
|
2022-02-14 20:31:59 +00:00
|
|
|
run: cargo doc --no-deps --no-default-features --features "full ${{ matrix.extra_features }}"
|
2020-12-17 03:00:48 +00:00
|
|
|
|
2020-12-28 16:02:57 +00:00
|
|
|
- name: Build (no features)
|
2021-03-02 22:48:43 +00:00
|
|
|
run: cargo build --lib --tests --no-default-features
|
|
|
|
|
2021-09-03 00:01:08 +00:00
|
|
|
# --no-default-features when used with `cargo build/test -p` doesn't seem to work!
|
|
|
|
- name: Build pyo3-build-config (no features)
|
|
|
|
run: |
|
|
|
|
cd pyo3-build-config
|
|
|
|
cargo build --no-default-features
|
|
|
|
|
2021-03-02 22:48:43 +00:00
|
|
|
# Run tests (except on PyPy, because no embedding API).
|
2021-04-02 09:39:47 +00:00
|
|
|
- if: ${{ !startsWith(matrix.python-version, 'pypy') }}
|
2021-03-02 22:48:43 +00:00
|
|
|
name: Test (no features)
|
2021-12-03 00:03:32 +00:00
|
|
|
run: cargo test --no-default-features --lib --tests
|
2020-08-07 00:50:11 +00:00
|
|
|
|
2021-09-03 00:01:08 +00:00
|
|
|
# --no-default-features when used with `cargo build/test -p` doesn't seem to work!
|
|
|
|
- name: Test pyo3-build-config (no features)
|
|
|
|
run: |
|
|
|
|
cd pyo3-build-config
|
|
|
|
cargo test --no-default-features
|
|
|
|
|
2020-12-28 16:02:57 +00:00
|
|
|
- name: Build (all additive features)
|
2022-02-14 20:31:59 +00:00
|
|
|
run: cargo build --lib --tests --no-default-features --features "full ${{ matrix.extra_features }}"
|
2020-08-07 00:50:11 +00:00
|
|
|
|
2021-11-15 04:11:30 +00:00
|
|
|
- if: ${{ startsWith(matrix.python-version, 'pypy') }}
|
2021-11-19 10:45:27 +00:00
|
|
|
name: Build PyPy (abi3-py37)
|
2022-02-14 20:31:59 +00:00
|
|
|
run: cargo build --lib --tests --no-default-features --features "abi3-py37 full ${{ matrix.extra_features }}"
|
2021-11-15 04:11:30 +00:00
|
|
|
|
2020-08-07 00:50:11 +00:00
|
|
|
# Run tests (except on PyPy, because no embedding API).
|
2021-04-02 09:39:47 +00:00
|
|
|
- if: ${{ !startsWith(matrix.python-version, 'pypy') }}
|
2020-08-07 00:50:11 +00:00
|
|
|
name: Test
|
2022-02-14 20:31:59 +00:00
|
|
|
run: cargo test --no-default-features --features "full ${{ matrix.extra_features }}"
|
2020-12-28 16:02:57 +00:00
|
|
|
|
2020-09-19 15:27:06 +00:00
|
|
|
# Run tests again, but in abi3 mode
|
2021-04-02 09:39:47 +00:00
|
|
|
- if: ${{ !startsWith(matrix.python-version, 'pypy') }}
|
2020-10-12 22:03:14 +00:00
|
|
|
name: Test (abi3)
|
2022-02-14 20:31:59 +00:00
|
|
|
run: cargo test --no-default-features --features "abi3 full ${{ matrix.extra_features }}"
|
2020-08-07 00:50:11 +00:00
|
|
|
|
2021-11-19 10:45:27 +00:00
|
|
|
# Run tests again, for abi3-py37 (the minimal Python version)
|
|
|
|
- if: ${{ (!startsWith(matrix.python-version, 'pypy')) && (matrix.python-version != '3.7') }}
|
|
|
|
name: Test (abi3-py37)
|
2022-02-14 20:31:59 +00:00
|
|
|
run: cargo test --no-default-features --features "abi3-py37 full ${{ matrix.extra_features }}"
|
2020-12-15 13:57:09 +00:00
|
|
|
|
2020-08-07 00:50:11 +00:00
|
|
|
- name: Test proc-macro code
|
2021-03-02 22:48:43 +00:00
|
|
|
run: cargo test --manifest-path=pyo3-macros-backend/Cargo.toml
|
2020-08-07 00:50:11 +00:00
|
|
|
|
2021-06-26 13:37:55 +00:00
|
|
|
- name: Test build config
|
|
|
|
run: cargo test --manifest-path=pyo3-build-config/Cargo.toml
|
|
|
|
|
2021-12-15 00:45:26 +00:00
|
|
|
- name: Test python examples and tests
|
2020-03-24 05:59:03 +00:00
|
|
|
shell: bash
|
2020-08-07 00:50:11 +00:00
|
|
|
run: |
|
2022-01-16 16:12:40 +00:00
|
|
|
python -m pip install -U pip nox
|
2021-12-26 22:39:42 +00:00
|
|
|
cargo xtask test-py
|
2021-03-02 22:48:43 +00:00
|
|
|
env:
|
2022-01-15 22:42:20 +00:00
|
|
|
CARGO_TARGET_DIR: ${{ github.workspace }}/target
|
2020-08-07 00:50:11 +00:00
|
|
|
|
2021-06-27 07:08:41 +00:00
|
|
|
- name: Test cross compilation
|
|
|
|
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
|
|
|
|
uses: messense/maturin-action@v1
|
|
|
|
env:
|
|
|
|
PYO3_CROSS_LIB_DIR: /opt/python/cp39-cp39/lib
|
|
|
|
with:
|
|
|
|
target: aarch64-unknown-linux-gnu
|
|
|
|
manylinux: auto
|
|
|
|
args: --release -i python3.9 --no-sdist -m examples/maturin-starter/Cargo.toml
|
|
|
|
|
2022-03-16 04:01:43 +00:00
|
|
|
- run: sudo rm -rf examples/maturin-starter/target
|
|
|
|
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
|
|
|
|
- name: Test cross compile to same architecture
|
|
|
|
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
|
|
|
|
uses: messense/maturin-action@v1
|
|
|
|
env:
|
|
|
|
PYO3_CROSS_LIB_DIR: /opt/python/cp39-cp39/lib
|
|
|
|
with:
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
manylinux: auto
|
|
|
|
args: --release -i python3.9 --no-sdist -m examples/maturin-starter/Cargo.toml
|
|
|
|
|
2022-03-02 03:45:17 +00:00
|
|
|
- name: Test cross compilation
|
|
|
|
if: ${{ matrix.platform.os == 'macos-latest' && matrix.python-version == '3.9' }}
|
|
|
|
uses: messense/maturin-action@v1
|
|
|
|
with:
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
args: --release -i python3.9 --no-sdist -m examples/maturin-starter/Cargo.toml
|
|
|
|
|
2022-04-10 14:05:30 +00:00
|
|
|
- name: Test cross compile to Windows
|
2022-04-10 14:29:03 +00:00
|
|
|
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
|
2022-04-10 15:16:04 +00:00
|
|
|
env:
|
2022-04-10 16:19:20 +00:00
|
|
|
XWIN_ARCH: x86_64
|
2022-04-10 14:05:30 +00:00
|
|
|
run: |
|
2022-05-10 13:44:35 +00:00
|
|
|
set -ex
|
2022-04-10 15:16:04 +00:00
|
|
|
sudo apt-get install -y mingw-w64 llvm
|
|
|
|
rustup target add x86_64-pc-windows-gnu x86_64-pc-windows-msvc
|
2022-04-12 09:04:40 +00:00
|
|
|
python -m pip install cargo-xwin
|
2022-05-10 13:44:35 +00:00
|
|
|
# abi3
|
2022-04-10 14:05:30 +00:00
|
|
|
cargo build --manifest-path examples/maturin-starter/Cargo.toml --features abi3 --target x86_64-pc-windows-gnu
|
2022-04-10 16:19:20 +00:00
|
|
|
cargo xwin build --manifest-path examples/maturin-starter/Cargo.toml --features abi3 --target x86_64-pc-windows-msvc
|
2022-05-10 13:44:35 +00:00
|
|
|
# non-abi3
|
|
|
|
export PYO3_CROSS_PYTHON_VERSION=3.9
|
|
|
|
cargo build --manifest-path examples/maturin-starter/Cargo.toml --features generate-import-lib --target x86_64-pc-windows-gnu
|
|
|
|
cargo xwin build --manifest-path examples/maturin-starter/Cargo.toml --features generate-import-lib --target x86_64-pc-windows-msvc
|
2022-04-10 14:05:30 +00:00
|
|
|
- name: Test cross compile to Windows with maturin
|
2022-04-10 14:29:03 +00:00
|
|
|
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
|
2022-04-10 14:05:30 +00:00
|
|
|
uses: messense/maturin-action@v1
|
|
|
|
with:
|
|
|
|
target: x86_64-pc-windows-gnu
|
2022-04-10 14:29:03 +00:00
|
|
|
args: -i python3.8 --no-sdist -m examples/maturin-starter/Cargo.toml --cargo-extra-args="--features abi3"
|
2022-04-10 14:05:30 +00:00
|
|
|
|
2020-01-12 14:33:34 +00:00
|
|
|
env:
|
2021-03-02 22:48:43 +00:00
|
|
|
CARGO_TERM_VERBOSE: true
|
|
|
|
CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }}
|
2020-01-12 14:33:34 +00:00
|
|
|
RUST_BACKTRACE: 1
|
2020-12-26 08:11:19 +00:00
|
|
|
RUSTFLAGS: "-D warnings"
|
2021-03-04 19:41:11 +00:00
|
|
|
RUSTDOCFLAGS: "-D warnings"
|
2020-12-28 16:02:57 +00:00
|
|
|
# TODO: this is a hack to workaround compile_error! warnings about auto-initialize on PyPy
|
|
|
|
# Once cargo's `resolver = "2"` is stable (~ MSRV Rust 1.52), remove this.
|
|
|
|
PYO3_CI: 1
|
2021-12-03 00:03:32 +00:00
|
|
|
# This is a hack to make CARGO_PRIMARY_PACKAGE always set even for the
|
|
|
|
# msrv job. MSRV is currently 1.48, but CARGO_PRIMARY_PACKAGE only came in
|
|
|
|
# 1.49.
|
|
|
|
CARGO_PRIMARY_PACKAGE: 1
|
2020-08-11 21:32:59 +00:00
|
|
|
|
|
|
|
coverage:
|
|
|
|
needs: [fmt]
|
2021-11-10 08:05:30 +00:00
|
|
|
name: coverage-${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: ["windows", "macos", "ubuntu"]
|
|
|
|
runs-on: ${{ matrix.os }}-latest
|
2020-08-11 21:32:59 +00:00
|
|
|
steps:
|
2022-06-02 06:32:51 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v3
|
2021-10-24 10:25:10 +00:00
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
2021-12-18 09:03:34 +00:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-04-04 07:49:27 +00:00
|
|
|
with:
|
2021-12-18 09:03:34 +00:00
|
|
|
key: coverage-cargo-${{ matrix.os }}
|
2021-04-19 08:50:25 +00:00
|
|
|
continue-on-error: true
|
2021-11-10 08:05:30 +00:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-04-08 12:24:10 +00:00
|
|
|
toolchain: stable
|
2021-11-10 08:05:30 +00:00
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
components: llvm-tools-preview
|
2022-01-24 22:58:36 +00:00
|
|
|
- name: Install cargo-llvm-cov
|
|
|
|
uses: taiki-e/install-action@cargo-llvm-cov
|
2022-02-04 08:53:12 +00:00
|
|
|
- run: python -m pip install -U pip nox
|
2022-01-24 22:58:36 +00:00
|
|
|
- run: cargo xtask coverage --output-lcov coverage.lcov
|
2021-10-24 07:15:20 +00:00
|
|
|
- uses: codecov/codecov-action@v2
|
2020-08-11 21:32:59 +00:00
|
|
|
with:
|
2021-04-04 07:49:27 +00:00
|
|
|
file: coverage.lcov
|
2021-11-10 08:05:30 +00:00
|
|
|
name: ${{ matrix.os }}
|
2022-06-08 04:59:18 +00:00
|
|
|
|
|
|
|
emscripten:
|
|
|
|
name: emscripten
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
2022-06-08 07:09:42 +00:00
|
|
|
id: setup-python
|
2022-06-08 04:59:18 +00:00
|
|
|
with:
|
2022-06-08 07:09:42 +00:00
|
|
|
python-version: 3.11-dev
|
2022-06-08 04:59:18 +00:00
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
target: wasm32-unknown-emscripten
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 14
|
|
|
|
- run: pip install nox
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
.nox/emscripten
|
2022-06-08 07:09:42 +00:00
|
|
|
key: ${{ hashFiles('emscripten/*') }} - ${{ hashFiles('noxfile.py') }} - ${{ steps.setup-python.outputs.python-path }}
|
2022-06-08 04:59:18 +00:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
with:
|
|
|
|
key: cargo-emscripten-wasm32
|
|
|
|
- name: Build
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
2022-06-08 07:09:42 +00:00
|
|
|
run: nox -s build-emscripten
|
2022-06-08 04:59:18 +00:00
|
|
|
- name: Test
|
2022-06-08 07:09:42 +00:00
|
|
|
run: nox -s test-emscripten
|