Skip to content

Commit c3bc992

Browse files
authored
chore(ci): add CI job for building nargo from source (#28)
1 parent c6c90a5 commit c3bc992

File tree

2 files changed

+51
-6
lines changed

2 files changed

+51
-6
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: [ubuntu, macos]
21-
toolchain: [stable, nightly, 0.1.0, 0.1.1, 0.2.0, 0.3.0]
21+
toolchain: [stable, nightly, 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.1]
2222
timeout-minutes: 45
2323
steps:
2424
- name: Parse toolchain
@@ -41,19 +41,64 @@ jobs:
4141
echo "${HOME}/.nargo/bin" >> $GITHUB_PATH
4242
env:
4343
INSTALL_URL: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref || github.ref_name }}/install
44+
NOIRUP_BIN_URL: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref || github.ref_name }}/noirup
4445
- name: Install nargo with noirup
4546
run: noirup ${{steps.parse.outputs.toolchain}}
4647
- name: Check nargo installation
4748
run: nargo --version
4849

50+
install-source:
51+
name: Noir ${{matrix.version}} (from source) on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}}
52+
runs-on: ${{matrix.os}}-latest
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
os: [ubuntu, macos]
57+
# Installing from source can technically target any commit.
58+
# However, we only guarantee that noirup will build release commits.
59+
version: [0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.1]
60+
timeout-minutes: 45
61+
steps:
62+
- name: Install noirup
63+
run: |
64+
curl -L $INSTALL_URL | bash
65+
echo "${HOME}/.nargo/bin" >> $GITHUB_PATH
66+
env:
67+
INSTALL_URL: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref || github.ref_name }}/install
68+
NOIRUP_BIN_URL: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref || github.ref_name }}/noirup
69+
70+
- uses: actions/cache@v3
71+
with:
72+
path: |
73+
~/.cargo/bin/
74+
~/.cargo/registry/index/
75+
~/.cargo/registry/cache/
76+
~/.cargo/git/db/
77+
key: ${{ runner.os }}-cargo-${{ matrix.version }}
78+
79+
- name: Install Barretenberg dependencies
80+
if: matrix.os == 'ubuntu'
81+
run: sudo apt update && sudo apt install clang lld cmake libomp-dev
82+
83+
- name: Install Barretenberg dependencies
84+
if: matrix.os == 'macos'
85+
run: brew install cmake llvm libomp
86+
87+
- name: Install nargo from source with noirup
88+
run: noirup $toolchain
89+
env:
90+
toolchain: -b tags/v${{matrix.version}}
91+
- name: Check nargo installation
92+
run: nargo --version
93+
4994
install-action:
5095
name: Noir ${{matrix.toolchain}} (GH action) on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}}
5196
runs-on: ${{matrix.os}}-latest
5297
strategy:
5398
fail-fast: false
5499
matrix:
55100
os: [ubuntu, macos]
56-
toolchain: [stable, nightly, 0.1.0, 0.1.1, 0.2.0, 0.3.0]
101+
toolchain: [stable, nightly, 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.1]
57102
timeout-minutes: 45
58103
steps:
59104
- uses: actions/checkout@v3

install

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ echo Installing noirup...
66
NARGO_HOME=${NARGO_HOME-"$HOME/.nargo"}
77
NARGO_BIN_DIR="$NARGO_HOME/bin"
88

9-
BIN_URL="https://github.com/noir-lang/noirup/releases/latest/download/noirup"
10-
BIN_PATH="$NARGO_BIN_DIR/noirup"
9+
NOIRUP_BIN_URL=${NOIRUP_BIN_URL-"https://github.com/noir-lang/noirup/releases/latest/download/noirup"}
10+
NOIRUP_BIN_PATH="$NARGO_BIN_DIR/noirup"
1111

1212
# Create the .nargo bin directory and noirup binary if it doesn't exist.
1313
mkdir -p $NARGO_BIN_DIR
14-
curl -# -L $BIN_URL -o $BIN_PATH
15-
chmod +x $BIN_PATH
14+
curl -# -L $NOIRUP_BIN_URL -o $NOIRUP_BIN_PATH
15+
chmod +x $NOIRUP_BIN_PATH
1616

1717
# Store the correct profile file (i.e. .profile for bash or .zshrc for ZSH).
1818
case $SHELL in

0 commit comments

Comments
 (0)