Add CI to build rust-toolchain archives #26
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: [ risc0 ] | |
pull_request: | |
branches: [ risc0 ] | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macOS | |
arch: ARM64 | |
triple: aarch64-apple-darwin | |
- os: macOS | |
arch: X64 | |
triple: x86_64-apple-darwin | |
- os: Linux | |
arch: X64 | |
triple: x86_64-unknown-linux-gnu | |
runs-on: [ self-hosted, prod, "${{ matrix.os }}", "${{ matrix.arch }}" ] | |
steps: | |
- name: Install Rust | |
uses: risc0/actions-rs-toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Check out risc0/rust | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
path: rust | |
# We need the full history for the main repo so the build tooling can | |
# determine the cached LLVM download. | |
- name: Fetch full branch history | |
run: | | |
cd rust | |
git fetch --unshallow origin $(git branch --show-current) | |
echo "Branch history fetched!" | |
- name: Check out risc0/risc0 | |
uses: actions/checkout@v3 | |
with: | |
repository: risc0/risc0 | |
ref: flaub/toolchain-ci | |
path: risc0 | |
- name: Build | |
run: GITHUB_ACTIONS=false RISC0_BUILD_DIR=$GITHUB_WORKSPACE cargo run --bin cargo-risczero -- risczero build-toolchain | |
working-directory: risc0 | |
- name: Archive build output | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rust-toolchain-${{ matrix.triple }} | |
path: | | |
rust/build/${{ matrix.triple }}/stage2 | |
!rust/build/${{ matrix.triple }}/stage2/lib/rustlib/src | |
!rust/build/${{ matrix.triple }}/stage2/lib/rustlib/rustc-src |