forked from paritytech/rustc-rv32e-toolchain
-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (79 loc) · 2.43 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
workflow_dispatch:
pull_request:
branches:
- "**"
paths-ignore:
- README.md
jobs:
build:
strategy:
matrix:
include:
- runner: [runs-on, runner=32cpu-linux-x64, "run-id=${{ github.run_id }}"]
os: ubuntu
cachekey: ubuntu-x86
- runner: [runs-on, runner=32cpu-linux-arm64, "run-id=${{ github.run_id }}"]
os: ubuntu
cachekey: ubuntu-arm64
- runner: self-hosted
os: macos
cachekey: macos-arm64
- runner: macos-13
os: macos
cachekey: macos-x86
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
steps:
- name: Install nightly toolchain
id: rustc-toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2024-05-29
- uses: lukka/[email protected]
- name: Show rust version
run: |
cargo version
rustup toolchain list
- name: Check out athenavm/rustc-rv32e-toolchain
uses: actions/checkout@v4
with:
submodules: recursive
path: toolchain
- name: Check out athenavm/athena
uses: actions/checkout@v4
with:
repository: athenavm/athena
ref: rust-commit-hash
path: athena
- name: Get Rust commit
run: |
RUST_COMMIT=$(cat toolchain/rust_commit.txt)
echo "Using Rust commit: $RUST_COMMIT"
echo "RUST_COMMIT=$RUST_COMMIT" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Cache Athena build
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
athena/target/
key: ${{ matrix.cachekey }}-athenabuild-${{ hashFiles('athena/**/Cargo.toml') }}
- uses: actions/cache@v4
name: Cache Rust toolchain
with:
path: |
toolchain/rust/build
toolchain/rust/library
toolchain/rust/src/doc
toolchain/rust/src/llvm-project
toolchain/rust/src/tools
key: ${{ matrix.cachekey }}-rusttoolchain-${{ env.RUST_COMMIT }}
- name: Build
run:
GITHUB_ACTIONS=false ATHENA_BUILD_DIR=$GITHUB_WORKSPACE/toolchain cargo run --bin cargo-athena -- athena
build-toolchain
working-directory: athena