CI workflow
This commit is contained in:
+14
-22
@@ -33,33 +33,27 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ runner.temp }}/cargo
|
|
||||||
${{ runner.temp }}/rustup
|
|
||||||
${{ runner.temp }}/osxcross
|
|
||||||
~/.cache/pip
|
~/.cache/pip
|
||||||
~/.cache/pip-wheel
|
~/.cache/pip-wheel
|
||||||
~/.cache/sccache
|
~/.cache/sccache
|
||||||
~/.cache/cargo-xwin
|
~/.cache/cargo-xwin
|
||||||
key: rust-cache-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ runner.os }}-${{ github.ref }}
|
~/.cargo
|
||||||
restore-keys: |
|
~/.osxcross
|
||||||
rust-cache-${{ matrix.platform.target }}-${{ runner.os }}-
|
key: cache-ubuntu-maturin-cross-compile
|
||||||
rust-cache-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Install Rust (rustup) if needed
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
set -e
|
|
||||||
export RUSTUP_HOME="${{ runner.temp }}/rustup"
|
|
||||||
export CARGO_HOME="${{ runner.temp }}/cargo"
|
|
||||||
if ! command -v rustc >/dev/null 2>&1; then
|
if ! command -v rustc >/dev/null 2>&1; then
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
else
|
||||||
|
rustup update
|
||||||
fi
|
fi
|
||||||
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install sccache and maturin
|
- name: Install sccache and maturin
|
||||||
run: |
|
run: |
|
||||||
export RUSTUP_HOME="${{ runner.temp }}/rustup"
|
source "~/.cargo/env" 2>/dev/null || true
|
||||||
export CARGO_HOME="${{ runner.temp }}/cargo"
|
|
||||||
source "$CARGO_HOME/env" 2>/dev/null || true
|
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install maturin ziglang
|
pip install maturin ziglang
|
||||||
if ! command -v sccache >/dev/null 2>&1; then
|
if ! command -v sccache >/dev/null 2>&1; then
|
||||||
@@ -69,9 +63,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install xwin
|
- name: Install xwin
|
||||||
run: |
|
run: |
|
||||||
export RUSTUP_HOME="${{ runner.temp }}/rustup"
|
source "~/.cargo/env" 2>/dev/null || true
|
||||||
export CARGO_HOME="${{ runner.temp }}/cargo"
|
|
||||||
source "$CARGO_HOME/env" 2>/dev/null || true
|
|
||||||
if ! command -v cargo-xwin >/dev/null 2>&1; then
|
if ! command -v cargo-xwin >/dev/null 2>&1; then
|
||||||
cargo install cargo-xwin || pip install cargo-xwin
|
cargo install cargo-xwin || pip install cargo-xwin
|
||||||
cargo xwin cache xwin
|
cargo xwin cache xwin
|
||||||
@@ -80,17 +72,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Install osxcross
|
- name: Install osxcross
|
||||||
run: |
|
run: |
|
||||||
export PATH="${{ runner.temp }}/osxcross/bin${PATH:+:${PATH}}"
|
export PATH="~/.osxcross/bin${PATH:+:${PATH}}"
|
||||||
if ! command -v osxcross >/dev/null 2>&1; then
|
if ! command -v osxcross >/dev/null 2>&1; then
|
||||||
wget https://nextcloud.wimpomp.nl/s/DcrTwoP3SeY7DQF/download -O osxcross.tar.gz
|
wget https://nextcloud.wimpomp.nl/s/DcrTwoP3SeY7DQF/download -O osxcross.tar.gz
|
||||||
tar -xzf osxcross.tar.gz -C ${{ runner.temp }}/
|
tar -xzf osxcross.tar.gz -C ~/
|
||||||
|
mv ~/osxcross ~/.osxcross
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
run: |
|
run: |
|
||||||
export CARGO_HOME="${{ runner.temp }}/cargo"
|
source "~/.cargo/env" 2>/dev/null || true
|
||||||
source "$CARGO_HOME/env" 2>/dev/null || true
|
export PATH="~/.osxcross/bin${PATH:+:${PATH}}"
|
||||||
export PATH="${{ runner.temp }}/osxcross/bin${PATH:+:${PATH}}"
|
|
||||||
maturin sdist --out dist
|
maturin sdist --out dist
|
||||||
rustup default nightly
|
rustup default nightly
|
||||||
rustup target add x86_64-unknown-linux-gnu --toolchain nightly
|
rustup target add x86_64-unknown-linux-gnu --toolchain nightly
|
||||||
|
|||||||
Reference in New Issue
Block a user