Skip to content

Commit b3349f8

Browse files
committed
Add initial CI
1 parent 2c09714 commit b3349f8

2 files changed

Lines changed: 87 additions & 0 deletions

File tree

.github/scripts/setup-chipyard.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
WORKDIR="${GITHUB_WORKSPACE:-$(pwd)}"
6+
CHIPYARD_DIR="${WORKDIR}/chipyard"
7+
8+
echo "[CI] WORKDIR=${WORKDIR}"
9+
echo "[CI] CHIPYARD_DIR=${CHIPYARD_DIR}"
10+
11+
rm -rf "${CHIPYARD_DIR}"
12+
git clone "https://github.com/ucb-bar/chipyard.git"
13+
cd "${CHIPYARD_DIR}"
14+
git checkout main
15+
16+
export MAKEFLAGS="${MAKEFLAGS:-"-j$(nproc)"}"
17+
18+
./build-setup.sh riscv-tools -s 6 -s 7 -s 8 -s 9
19+
20+
# export CHIPYARD_DIR to later workflow steps
21+
if [[ -n "${GITHUB_ENV:-}" ]]; then
22+
{
23+
echo "CHIPYARD_DIR=${CHIPYARD_DIR}"
24+
} >> "${GITHUB_ENV}"
25+
fi
26+
27+
echo "[CI] Chipyard setup complete in ${CHIPYARD_DIR}"

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ ci ]
6+
pull_request:
7+
8+
jobs:
9+
chipyard-setup:
10+
runs-on: ubuntu-latest
11+
12+
defaults:
13+
run:
14+
# for conda activation
15+
shell: bash -el {0}
16+
17+
env:
18+
MAKEFLAGS: "-j$(nproc)"
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Install conda
25+
uses: conda-incubator/setup-miniconda@v3
26+
with:
27+
miniforge-variant: Miniforge3
28+
miniforge-version: latest
29+
auto-update-conda: true
30+
auto-activate: true
31+
activate-environment: ""
32+
# needed for conda caching
33+
use-only-tar-bz2: true
34+
35+
- name: Setup conda
36+
# conda install -n base conda-libmamba-solver
37+
# conda config --set solver libmamba
38+
# conda install -n base conda-lock==1.4.0
39+
run: |
40+
conda activate base
41+
42+
- name: Cache Scala deps
43+
uses: actions/cache@v5
44+
with:
45+
path: |
46+
~/.ivy2/cache
47+
~/.sbt
48+
~/.cache/coursier
49+
key: ${{ runner.os }}-scala-${{ hashFiles('**/*.sbt', '**/project/**') }}
50+
restore-keys: |
51+
${{ runner.os }}-scala-
52+
53+
- name: Chipyard setup
54+
run: |
55+
.github/scripts/setup-chipyard.sh
56+
57+
# - name: radiance
58+
# run: |
59+
# source "$CHIPYARD_DIR/env.sh"
60+
# ...

0 commit comments

Comments
 (0)