Manual Build #91
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Manual Build | |
env: | |
# cargo-nextest version to build | |
NEXTEST_VERSION: "0.9.81" | |
on: | |
# To run manually workflow | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build cargo-nextest | |
runs-on: ubuntu-latest | |
timeout-minutes: 90 | |
steps: | |
# Checkout only build script and script for CI | |
- name: Checkout build script | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
build.sh | |
ci/openbsd_build.sh | |
fake_rustc_openbsd-stable.sh | |
# Git clone cargo-nextest for tag = NEXTEST_VERSION | |
# Necessary for Swatinem/rust-cache action | |
- name: Checkout cargo-nextest sources | |
run: git -c advice.detachedHead=false clone --depth 1 --branch cargo-nextest-${{ env.NEXTEST_VERSION }} https://github.com/nextest-rs/nextest.git ${GITHUB_WORKSPACE}/cargo-nextest-build | |
# Check fake rustc version for OpenBSD-stable 7.5 (rustc 1.76) | |
# Necessary for Swatinem/rust-cache action | |
- name: Set fake rustc version for OpenBSD-stable | |
run: | | |
sudo cp /home/runner/.cargo/bin/rustc rustc.orig | |
sudo cp fake_rustc_openbsd-stable.sh /home/runner/.cargo/bin/rustc | |
echo "## Fake rustc version for OpenBSD-stable" | |
rustc -vV | |
# Action for Rust cache (copy to/from VM via copyback) | |
- name: Configure Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: cargo-nextest-build | |
# Restore original rustc binary | |
- name: Restore rustc binary | |
run: | | |
mv rustc.orig /home/runner/.cargo/bin/rustc | |
echo "## rustc version for Ubuntu runner" | |
rustc -vV | |
# Prepare OpenBSD-stable VM and run build | |
- name: Prepare OpenBSD VM and build | |
uses: vmactions/[email protected] | |
with: | |
usesh: true | |
sync: rsync | |
copyback: true | |
envs: 'NEXTEST_VERSION' | |
# Install requirements to build cargo-nextest | |
prepare: pkg_add -I bash curl rust zstd | |
# implementation modelled from https://github.com/rust-lang/rustup/blob/master/.github/workflows/ci.yaml | |
# * NOTE: All steps need to be run in this block, otherwise, we are operating back on the Ubuntu host | |
run: bash ci/openbsd_build.sh | |
# Run commands on Ubuntu host | |
- name: Check artifact on Ubuntu runner | |
run: | | |
sudo apt-get install -y file | |
echo "# pwd" | |
pwd | |
echo "# ls -l cargo-nextest-build/target/release/cargo-nextest" | |
ls -l cargo-nextest-build/target/release/cargo-nextest | |
echo "# Check cargo-nextest file" | |
file cargo-nextest-build/target/release/cargo-nextest | |
# Upload artifact for cargo-nextest binary | |
- name: Upload cargo-nextest binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cargo-nextest-${{ env.NEXTEST_VERSION }}-openbsd | |
# Wildcard used to flatten directory hierarchy | |
path: cargo-nextest-build/target/release/*-nextest | |
if-no-files-found: error | |
retention-days: 0 |