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