From 71dcc247b26558b1c0d756e199a77a0fc683bc2a Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Sat, 14 Jun 2025 16:19:42 +0100 Subject: [PATCH] ci cleanup --- .github/actions/job-setup/action.yml | 17 ++++++++++++ .github/workflows/build-packages.yml | 5 +++- .github/workflows/build-python.yml | 39 ++++++++++++++++++++------- .github/workflows/build-rust.yml | 15 ++++++----- .github/workflows/build-tests.yml | 40 +++++++++++++++++++--------- 5 files changed, 87 insertions(+), 29 deletions(-) diff --git a/.github/actions/job-setup/action.yml b/.github/actions/job-setup/action.yml index eb2cede3..5193f0e5 100644 --- a/.github/actions/job-setup/action.yml +++ b/.github/actions/job-setup/action.yml @@ -1,9 +1,21 @@ name: "Setup Job Environment" 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: using: "composite" steps: - name: Setup dotnet + if: inputs.update-dotnet == 'true' uses: actions/setup-dotnet@v4 with: dotnet-version: | @@ -22,3 +34,8 @@ runs: - name: Update Project Version shell: pwsh run: ./.github/set-nbgv-version.ps1 + - name: Rust Cache + if: inputs.rust-cache == 'true' + uses: Swatinem/rust-cache@v2 + with: + key: "${{ github.workflow }}" diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index 402d1514..807207ae 100644 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -9,7 +9,10 @@ jobs: - uses: actions/checkout@v4 with: 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 uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/build-python.yml b/.github/workflows/build-python.yml index 2f1f1cb7..a9842dee 100644 --- a/.github/workflows/build-python.yml +++ b/.github/workflows/build-python.yml @@ -6,13 +6,14 @@ jobs: linux: runs-on: ${{ matrix.platform.runner }} strategy: + fail-fast: false matrix: platform: - runner: ubuntu-22.04 target: x86_64 - runner: ubuntu-22.04 target: x86 - - runner: ubuntu-22.04 + - runner: ubuntu-22.04-arm target: aarch64 - runner: ubuntu-22.04 target: armv7 @@ -21,10 +22,16 @@ jobs: - runner: ubuntu-22.04 target: ppc64le 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 with: fetch-depth: 0 - - uses: ./.github/actions/job-setup + - name: Setup Job Environment + uses: ./.github/actions/job-setup - uses: actions/setup-python@v5 with: python-version: 3.x @@ -53,6 +60,7 @@ jobs: musllinux: runs-on: ${{ matrix.platform.runner }} strategy: + fail-fast: false matrix: platform: - runner: ubuntu-22.04 @@ -67,7 +75,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: ./.github/actions/job-setup + - name: Setup Job Environment + uses: ./.github/actions/job-setup - uses: actions/setup-python@v5 with: python-version: 3.x @@ -96,33 +105,42 @@ jobs: windows: runs-on: ${{ matrix.platform.runner }} strategy: + fail-fast: false matrix: platform: - runner: windows-latest target: x64 + rust_target: x86_64-pc-windows-msvc - runner: windows-latest target: x86 + rust_target: i686-pc-windows-msvc + - runner: windows-11-arm + target: arm64 + rust_target: aarch64-pc-windows-msvc steps: + - uses: actions-rust-lang/setup-rust-toolchain@v1 + if: ${{ matrix.platform.runner == 'windows-11-arm' }} - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: ./.github/actions/job-setup + - name: Setup Job Environment + uses: ./.github/actions/job-setup - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: 3.13t architecture: ${{ matrix.platform.target }} - name: Build wheels uses: PyO3/maturin-action@v1 with: working-directory: src/lib-python - target: ${{ matrix.platform.target }} + target: ${{ matrix.platform.rust_target }} args: --release --out dist sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Build free-threaded wheels uses: PyO3/maturin-action@v1 with: working-directory: src/lib-python - target: ${{ matrix.platform.target }} + target: ${{ matrix.platform.rust_target }} args: --release --out dist -i python3.13t sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Upload wheels @@ -134,6 +152,7 @@ jobs: macos: runs-on: ${{ matrix.platform.runner }} strategy: + fail-fast: false matrix: platform: - runner: macos-13 @@ -144,7 +163,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: ./.github/actions/job-setup + - name: Setup Job Environment + uses: ./.github/actions/job-setup - uses: actions/setup-python@v5 with: python-version: 3.x @@ -174,7 +194,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: ./.github/actions/job-setup + - name: Setup Job Environment + uses: ./.github/actions/job-setup - name: Build sdist uses: PyO3/maturin-action@v1 with: diff --git a/.github/workflows/build-rust.yml b/.github/workflows/build-rust.yml index d099ccf2..872ace81 100644 --- a/.github/workflows/build-rust.yml +++ b/.github/workflows/build-rust.yml @@ -11,10 +11,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: ./.github/actions/job-setup - - uses: Swatinem/rust-cache@v2 + - name: Setup Job Environment + uses: ./.github/actions/job-setup with: - key: "rust-build-windows" + rust-cache: true - name: Install Dependencies run: | rustup target add aarch64-pc-windows-msvc --toolchain nightly-x86_64-pc-windows-msvc @@ -69,7 +69,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: ./.github/actions/job-setup + - name: Setup Job Environment + uses: ./.github/actions/job-setup - name: Install Dependencies run: | 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 with: fetch-depth: 0 - - uses: ./.github/actions/job-setup - - uses: Swatinem/rust-cache@v2 + - name: Setup Job Environment + uses: ./.github/actions/job-setup with: - key: "rust-build-macos" + rust-cache: true - name: Install Dependencies run: | rustup target add x86_64-apple-darwin diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 6ecc552a..4f1f2585 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -11,7 +11,7 @@ env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} jobs: - test-bins: + rust: strategy: fail-fast: false matrix: @@ -24,19 +24,12 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: Swatinem/rust-cache@v2 - with: - key: "rust-test-${{ matrix.os }}" + - name: Setup Job Environment + uses: ./.github/actions/job-setup - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - name: Check lib-rust 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 run: cargo llvm-cov ${{ matrix.rust_flags }} --cobertura --output-path ./test/coverage.rust.${{ matrix.os }}.xml - name: Upload Coverage @@ -44,8 +37,28 @@ jobs: with: files: ./test/coverage.rust.${{ matrix.os }}.xml - test-vpk: + nodejs: 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: os: [windows-latest, ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} @@ -58,7 +71,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: ./.github/actions/job-setup + - name: Setup Job Environment + uses: ./.github/actions/job-setup + with: + update-dotnet: true - name: Install FUSE run: | sudo add-apt-repository universe