fix: CI workflow for Forgejo act runner — drop container, install Rust via rustup
The act runner doesn't have Node.js in the rust:1-bookworm container, breaking JS-based actions (checkout, cache, upload-artifact). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,49 +7,46 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
targets:
|
targets:
|
||||||
description: 'Targets to build (comma-separated: amd64,arm64,armv7,mac-arm64)'
|
description: 'Targets to build (comma-separated: amd64,arm64,armv7)'
|
||||||
required: false
|
required: false
|
||||||
default: 'amd64'
|
default: 'amd64'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
RUSTUP_HOME: /tmp/rustup
|
||||||
|
CARGO_HOME: /tmp/cargo
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Always builds on push tags. On manual dispatch, reads inputs.
|
|
||||||
build-amd64:
|
build-amd64:
|
||||||
if: >-
|
if: >-
|
||||||
github.event_name == 'push' ||
|
github.event_name == 'push' ||
|
||||||
contains(github.event.inputs.targets, 'amd64')
|
contains(github.event.inputs.targets, 'amd64')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: rust:1-bookworm
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install Rust and dependencies
|
||||||
run: apt-get update && apt-get install -y cmake pkg-config libasound2-dev
|
run: |
|
||||||
|
apt-get update && apt-get install -y curl cmake pkg-config libasound2-dev build-essential
|
||||||
- name: Cache cargo
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0
|
||||||
uses: actions/cache@v4
|
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
target
|
|
||||||
key: cargo-amd64-${{ hashFiles('Cargo.lock') }}
|
|
||||||
restore-keys: cargo-amd64-
|
|
||||||
|
|
||||||
- name: Build headless binaries
|
- name: Build headless binaries
|
||||||
run: cargo build --release --bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
run: |
|
||||||
|
export PATH="$CARGO_HOME/bin:$PATH"
|
||||||
|
cargo build --release --bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
||||||
|
|
||||||
- name: Build audio client
|
- name: Build audio client
|
||||||
run: |
|
run: |
|
||||||
|
export PATH="$CARGO_HOME/bin:$PATH"
|
||||||
cargo build --release --bin wzp-client --features audio
|
cargo build --release --bin wzp-client --features audio
|
||||||
cp target/release/wzp-client target/release/wzp-client-audio
|
cp target/release/wzp-client target/release/wzp-client-audio
|
||||||
cargo build --release --bin wzp-client
|
cargo build --release --bin wzp-client
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --workspace --lib
|
run: |
|
||||||
|
export PATH="$CARGO_HOME/bin:$PATH"
|
||||||
|
cargo test --workspace --lib
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
@@ -73,33 +70,25 @@ jobs:
|
|||||||
github.event_name == 'push' ||
|
github.event_name == 'push' ||
|
||||||
contains(github.event.inputs.targets, 'arm64')
|
contains(github.event.inputs.targets, 'arm64')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: rust:1-bookworm
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install cross-compilation tools
|
- name: Install Rust and cross-compilation tools
|
||||||
run: |
|
run: |
|
||||||
dpkg --add-architecture arm64
|
dpkg --add-architecture arm64
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y cmake pkg-config gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
apt-get install -y curl cmake pkg-config gcc-aarch64-linux-gnu libc6-dev-arm64-cross build-essential
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0
|
||||||
|
export PATH="$CARGO_HOME/bin:$PATH"
|
||||||
rustup target add aarch64-unknown-linux-gnu
|
rustup target add aarch64-unknown-linux-gnu
|
||||||
|
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
|
||||||
- name: Cache cargo
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
target
|
|
||||||
key: cargo-arm64-${{ hashFiles('Cargo.lock') }}
|
|
||||||
restore-keys: cargo-arm64-
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||||
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
|
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
|
||||||
run: |
|
run: |
|
||||||
|
export PATH="$CARGO_HOME/bin:$PATH"
|
||||||
cargo build --release --target aarch64-unknown-linux-gnu \
|
cargo build --release --target aarch64-unknown-linux-gnu \
|
||||||
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
||||||
|
|
||||||
@@ -124,33 +113,25 @@ jobs:
|
|||||||
github.event_name == 'push' ||
|
github.event_name == 'push' ||
|
||||||
contains(github.event.inputs.targets, 'armv7')
|
contains(github.event.inputs.targets, 'armv7')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: rust:1-bookworm
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install cross-compilation tools
|
- name: Install Rust and cross-compilation tools
|
||||||
run: |
|
run: |
|
||||||
dpkg --add-architecture armhf
|
dpkg --add-architecture armhf
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y cmake pkg-config gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
|
apt-get install -y curl cmake pkg-config gcc-arm-linux-gnueabihf libc6-dev-armhf-cross build-essential
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0
|
||||||
|
export PATH="$CARGO_HOME/bin:$PATH"
|
||||||
rustup target add armv7-unknown-linux-gnueabihf
|
rustup target add armv7-unknown-linux-gnueabihf
|
||||||
|
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
|
||||||
- name: Cache cargo
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
target
|
|
||||||
key: cargo-armv7-${{ hashFiles('Cargo.lock') }}
|
|
||||||
restore-keys: cargo-armv7-
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
||||||
CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc
|
CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc
|
||||||
run: |
|
run: |
|
||||||
|
export PATH="$CARGO_HOME/bin:$PATH"
|
||||||
cargo build --release --target armv7-unknown-linux-gnueabihf \
|
cargo build --release --target armv7-unknown-linux-gnueabihf \
|
||||||
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
||||||
|
|
||||||
@@ -170,7 +151,6 @@ jobs:
|
|||||||
name: wzp-linux-armv7
|
name: wzp-linux-armv7
|
||||||
path: dist/wzp-linux-armv7.tar.gz
|
path: dist/wzp-linux-armv7.tar.gz
|
||||||
|
|
||||||
# Release job — creates a release with all artifacts when a tag is pushed
|
|
||||||
release:
|
release:
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
needs: [build-amd64]
|
needs: [build-amd64]
|
||||||
|
|||||||
Reference in New Issue
Block a user