chore: Re-open #3258 #2557
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: Wasm | |
on: | |
pull_request: | |
merge_group: | |
push: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-nargo: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
target: [x86_64-unknown-linux-gnu] | |
steps: | |
- name: Checkout Noir repo | |
uses: actions/checkout@v4 | |
- name: Setup toolchain | |
uses: dtolnay/rust-toolchain@1.71.1 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.target }} | |
cache-on-failure: true | |
save-if: ${{ github.event_name != 'merge_group' }} | |
- name: Build Nargo | |
run: cargo build --package nargo_cli --release | |
- name: Package artifacts | |
run: | | |
mkdir dist | |
cp ./target/release/nargo ./dist/nargo | |
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nargo | |
path: ./dist/* | |
retention-days: 3 | |
build-wasm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup Nix | |
uses: ./.github/actions/nix | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
nix-cache-name: "noir" | |
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }} | |
- name: Build wasm package | |
run: | | |
nix build -L .#noir_wasm | |
- name: Dereference symlink | |
run: echo "UPLOAD_PATH=$(readlink -f ./result/noir_wasm)" >> $GITHUB_ENV | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: noir_wasm | |
path: ${{ env.UPLOAD_PATH }} | |
retention-days: 3 | |
test: | |
needs: [build-wasm, build-nargo] | |
name: Test noir_wasm | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout noir-lang/noir | |
uses: actions/checkout@v4 | |
- name: Download wasm package artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: noir_wasm | |
path: ./compiler/wasm/downloaded | |
- name: Download nargo binary | |
uses: actions/download-artifact@v3 | |
with: | |
name: nargo | |
path: ./nargo | |
- name: Compile fixtures with Nargo CLI | |
working-directory: ./compiler/wasm/fixtures | |
run: | | |
nargo_binary=${{ github.workspace }}/nargo/nargo | |
chmod +x $nargo_binary | |
for dir in $(ls -d */); do | |
pushd $dir/noir-script | |
$nargo_binary compile | |
popd | |
done | |
- name: Install Yarn dependencies | |
uses: ./.github/actions/setup | |
- name: Install Playwright | |
uses: ./.github/actions/install-playwright | |
- name: Install dependencies | |
run: | | |
cp -r ./compiler/wasm/downloaded/nodejs ./compiler/wasm | |
cp -r ./compiler/wasm/downloaded/web ./compiler/wasm | |
yarn workspace @noir-lang/source-resolver build | |
- name: Run node tests | |
run: yarn workspace @noir-lang/noir_wasm test:node | |
- name: Run browser tests | |
run: yarn workspace @noir-lang/noir_wasm test:browser |