ci cleanup

This commit is contained in:
Caelan Sayler
2025-06-14 16:19:42 +01:00
committed by Caelan
parent 8cda06cfd7
commit 71dcc247b2
5 changed files with 87 additions and 29 deletions

View File

@@ -1,9 +1,21 @@
name: "Setup Job Environment" name: "Setup Job Environment"
description: "Installs dependencies like dotnet, rust, etc." description: "Installs dependencies like dotnet, rust, etc."
inputs:
update-dotnet:
description: 'Whether to run the setup-dotnet action'
required: false
default: 'false'
rust-cache:
description: 'Whether to run the rust-cache action'
required: false
default: 'false'
runs: runs:
using: "composite" using: "composite"
steps: steps:
- name: Setup dotnet - name: Setup dotnet
if: inputs.update-dotnet == 'true'
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: | dotnet-version: |
@@ -22,3 +34,8 @@ runs:
- name: Update Project Version - name: Update Project Version
shell: pwsh shell: pwsh
run: ./.github/set-nbgv-version.ps1 run: ./.github/set-nbgv-version.ps1
- name: Rust Cache
if: inputs.rust-cache == 'true'
uses: Swatinem/rust-cache@v2
with:
key: "${{ github.workflow }}"

View File

@@ -9,7 +9,10 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
uses: ./.github/actions/job-setup
with:
update-dotnet: true
- name: Download Rust Artifacts - name: Download Rust Artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:

View File

@@ -6,13 +6,14 @@ jobs:
linux: linux:
runs-on: ${{ matrix.platform.runner }} runs-on: ${{ matrix.platform.runner }}
strategy: strategy:
fail-fast: false
matrix: matrix:
platform: platform:
- runner: ubuntu-22.04 - runner: ubuntu-22.04
target: x86_64 target: x86_64
- runner: ubuntu-22.04 - runner: ubuntu-22.04
target: x86 target: x86
- runner: ubuntu-22.04 - runner: ubuntu-22.04-arm
target: aarch64 target: aarch64
- runner: ubuntu-22.04 - runner: ubuntu-22.04
target: armv7 target: armv7
@@ -21,10 +22,16 @@ jobs:
- runner: ubuntu-22.04 - runner: ubuntu-22.04
target: ppc64le target: ppc64le
steps: steps:
- name: Install Dependencies
if: ${{ matrix.platform.runner == 'ubuntu-22.04-arm' }}
run: |
sudo apt update
sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
uses: ./.github/actions/job-setup
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: 3.x python-version: 3.x
@@ -53,6 +60,7 @@ jobs:
musllinux: musllinux:
runs-on: ${{ matrix.platform.runner }} runs-on: ${{ matrix.platform.runner }}
strategy: strategy:
fail-fast: false
matrix: matrix:
platform: platform:
- runner: ubuntu-22.04 - runner: ubuntu-22.04
@@ -67,7 +75,8 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
uses: ./.github/actions/job-setup
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: 3.x python-version: 3.x
@@ -96,33 +105,42 @@ jobs:
windows: windows:
runs-on: ${{ matrix.platform.runner }} runs-on: ${{ matrix.platform.runner }}
strategy: strategy:
fail-fast: false
matrix: matrix:
platform: platform:
- runner: windows-latest - runner: windows-latest
target: x64 target: x64
rust_target: x86_64-pc-windows-msvc
- runner: windows-latest - runner: windows-latest
target: x86 target: x86
rust_target: i686-pc-windows-msvc
- runner: windows-11-arm
target: arm64
rust_target: aarch64-pc-windows-msvc
steps: steps:
- uses: actions-rust-lang/setup-rust-toolchain@v1
if: ${{ matrix.platform.runner == 'windows-11-arm' }}
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
uses: ./.github/actions/job-setup
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: 3.x python-version: 3.13t
architecture: ${{ matrix.platform.target }} architecture: ${{ matrix.platform.target }}
- name: Build wheels - name: Build wheels
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
with: with:
working-directory: src/lib-python working-directory: src/lib-python
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.rust_target }}
args: --release --out dist args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Build free-threaded wheels - name: Build free-threaded wheels
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
with: with:
working-directory: src/lib-python working-directory: src/lib-python
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.rust_target }}
args: --release --out dist -i python3.13t args: --release --out dist -i python3.13t
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload wheels - name: Upload wheels
@@ -134,6 +152,7 @@ jobs:
macos: macos:
runs-on: ${{ matrix.platform.runner }} runs-on: ${{ matrix.platform.runner }}
strategy: strategy:
fail-fast: false
matrix: matrix:
platform: platform:
- runner: macos-13 - runner: macos-13
@@ -144,7 +163,8 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
uses: ./.github/actions/job-setup
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: 3.x python-version: 3.x
@@ -174,7 +194,8 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
uses: ./.github/actions/job-setup
- name: Build sdist - name: Build sdist
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
with: with:

View File

@@ -11,10 +11,10 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
- uses: Swatinem/rust-cache@v2 uses: ./.github/actions/job-setup
with: with:
key: "rust-build-windows" rust-cache: true
- name: Install Dependencies - name: Install Dependencies
run: | run: |
rustup target add aarch64-pc-windows-msvc --toolchain nightly-x86_64-pc-windows-msvc rustup target add aarch64-pc-windows-msvc --toolchain nightly-x86_64-pc-windows-msvc
@@ -69,7 +69,8 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
uses: ./.github/actions/job-setup
- name: Install Dependencies - name: Install Dependencies
run: | run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
@@ -131,10 +132,10 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
- uses: Swatinem/rust-cache@v2 uses: ./.github/actions/job-setup
with: with:
key: "rust-build-macos" rust-cache: true
- name: Install Dependencies - name: Install Dependencies
run: | run: |
rustup target add x86_64-apple-darwin rustup target add x86_64-apple-darwin

View File

@@ -11,7 +11,7 @@ env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs: jobs:
test-bins: rust:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@@ -24,19 +24,12 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: Swatinem/rust-cache@v2 - name: Setup Job Environment
with: uses: ./.github/actions/job-setup
key: "rust-test-${{ matrix.os }}"
- name: Install cargo-llvm-cov - name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov
- name: Check lib-rust - name: Check lib-rust
run: cargo check -p velopack -F async run: cargo check -p velopack -F async
- name: Check lib-nodejs
working-directory: src/lib-nodejs
run: |
npm install
npm run build
npm run test
- name: Test Rust - name: Test Rust
run: cargo llvm-cov ${{ matrix.rust_flags }} --cobertura --output-path ./test/coverage.rust.${{ matrix.os }}.xml run: cargo llvm-cov ${{ matrix.rust_flags }} --cobertura --output-path ./test/coverage.rust.${{ matrix.os }}.xml
- name: Upload Coverage - name: Upload Coverage
@@ -44,8 +37,28 @@ jobs:
with: with:
files: ./test/coverage.rust.${{ matrix.os }}.xml files: ./test/coverage.rust.${{ matrix.os }}.xml
test-vpk: nodejs:
strategy: strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Job Environment
uses: ./.github/actions/job-setup
- name: Check lib-nodejs
working-directory: src/lib-nodejs
run: |
npm install
npm run build
npm run test
vpk:
strategy:
fail-fast: false
matrix: matrix:
os: [windows-latest, ubuntu-latest, macos-latest] os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -58,7 +71,10 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./.github/actions/job-setup - name: Setup Job Environment
uses: ./.github/actions/job-setup
with:
update-dotnet: true
- name: Install FUSE - name: Install FUSE
run: | run: |
sudo add-apt-repository universe sudo add-apt-repository universe