Skip to content

Manual Build

Manual Build #79

Workflow file for this run

name: Manual Build
env:
# cargo-nextest version to build
NEXTEST_VERSION: "0.9.72"
on:
# To run manually workflow
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build cargo-nextest
runs-on: ubuntu-latest
timeout-minutes: 90
env:
mem: 4096
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
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
# Use sccache for compilation cache (Rust)
- name: Configure sccache
uses: mozilla-actions/sccache-action@v0.0.4
# Prepare OpenBSD-stable VM and run build
- name: Prepare OpenBSD VM and build
uses: vmactions/openbsd-vm@v1.0.8
with:
usesh: true
sync: rsync
copyback: true
envs: "NEXTEST_VERSION SCCACHE_GHA_ENABLED RUSTC_WRAPPER ACTIONS_CACHE_URL ACTIONS_RUNTIME_TOKEN"
# Install requirements to build cargo-nextest
prepare: pkg_add -I bash curl rust zstd sccache
# 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