CI workflow
This commit is contained in:
@@ -32,22 +32,54 @@ jobs:
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Install Rust (rustup)
|
||||
env:
|
||||
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET || '' }} # optional
|
||||
- name: Cache Rust and sccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
${{ runner.temp }}/cargo
|
||||
${{ runner.temp }}/rustup
|
||||
~/.cache/pip
|
||||
~/.cache/pip-wheel
|
||||
~/.cache/sccache
|
||||
key: rust-cache-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ runner.os }}-${{ github.ref }}
|
||||
restore-keys: |
|
||||
rust-cache-${{ matrix.platform.target }}-${{ runner.os }}-
|
||||
rust-cache-${{ runner.os }}-
|
||||
|
||||
- name: Install Rust (rustup) if needed
|
||||
run: |
|
||||
set -e
|
||||
export RUSTUP_HOME="${{ runner.temp }}/rustup"
|
||||
export CARGO_HOME="${{ runner.temp }}/cargo"
|
||||
export PATH="$CARGO_HOME/bin:$PATH"
|
||||
if ! command -v rustc >/dev/null 2>&1; then
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source $HOME/.cargo/env
|
||||
source "$CARGO_HOME/env" 2>/dev/null || true
|
||||
rustup default nightly
|
||||
rustup target add x86_64-unknown-linux-gnu
|
||||
cargo install sccache
|
||||
fi
|
||||
rustup target add "${{ matrix.platform.target }}" || true
|
||||
shell: bash
|
||||
|
||||
- name: Install sccache and maturin
|
||||
run: |
|
||||
export RUSTUP_HOME="${{ runner.temp }}/rustup"
|
||||
export CARGO_HOME="${{ runner.temp }}/cargo"
|
||||
export PATH="$CARGO_HOME/bin:$PATH"
|
||||
python -m pip install --upgrade pip
|
||||
pip install maturin
|
||||
if ! command -v sccache >/dev/null 2>&1; then
|
||||
cargo install sccache || pip install sccache
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Build wheels
|
||||
run: |
|
||||
source $HOME/.cargo/env
|
||||
python -m pip install maturin
|
||||
maturin build --release --out dist --find-interpreter --target ${{ matrix.platform.target }}
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@v3.2.2
|
||||
with:
|
||||
name: wheels-linux-${{ matrix.platform.target }}
|
||||
path: dist
|
||||
|
||||
Reference in New Issue
Block a user