Skip to content

Commit 38511a5

Browse files
committed
ci stuff
1 parent 26c51e4 commit 38511a5

File tree

8 files changed

+251
-0
lines changed

8 files changed

+251
-0
lines changed

.github/NIGHTLY_CANARY_DIED.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Tests fail on latest Nargo nightly release"
3+
---
4+
5+
The tests on this Noir project have started failing when using the latest nightly release of the Noir compiler. This likely means that there have been breaking changes for which this project needs to be updated to take into account.
6+
7+
Check the [{{env.WORKFLOW_NAME}}]({{env.WORKFLOW_URL}}) workflow for details.

.github/workflows/benchmark.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Benchmarks
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: Benchmark library
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout sources
15+
uses: actions/checkout@v4
16+
17+
- name: Install Nargo
18+
uses: noir-lang/[email protected]
19+
with:
20+
toolchain: 0.34.0
21+
22+
- name: Install bb
23+
run: |
24+
npm install -g bbup
25+
bbup -nv 0.34.0
26+
27+
- name: Build Noir benchmark programs
28+
run: nargo export
29+
30+
- name: Generate gates report
31+
run: ./scripts/build-gates-report.sh
32+
env:
33+
BACKEND: /home/runner/.bb/bb
34+
35+
- name: Compare gates reports
36+
id: gates_diff
37+
uses: noir-lang/noir-gates-diff@1931aaaa848a1a009363d6115293f7b7fc72bb87
38+
with:
39+
report: gates_report.json
40+
summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%)
41+
42+
- name: Add gates diff to sticky comment
43+
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
44+
uses: marocchino/sticky-pull-request-comment@v2
45+
with:
46+
# delete the comment in case changes no longer impact circuit sizes
47+
delete: ${{ !steps.gates_diff.outputs.markdown }}
48+
message: ${{ steps.gates_diff.outputs.markdown }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Noir Nightly Canary
2+
3+
on:
4+
schedule:
5+
# Run a check at 9 AM UTC
6+
- cron: "0 9 * * *"
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
permissions:
12+
issues: write
13+
14+
jobs:
15+
test:
16+
name: Test on Nargo ${{matrix.toolchain}}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout sources
20+
uses: actions/checkout@v4
21+
22+
- name: Install Nargo
23+
uses: noir-lang/[email protected]
24+
with:
25+
toolchain: nightly
26+
27+
- name: Run Noir tests
28+
run: nargo test
29+
30+
- name: Alert on dead links
31+
uses: JasonEtco/create-an-issue@v2
32+
if: ${{ failure() }}
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
WORKFLOW_NAME: ${{ github.workflow }}
36+
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
37+
with:
38+
update_existing: true
39+
filename: .github/NIGHTLY_CANARY_DIED.md
40+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Pull Request
2+
3+
on:
4+
merge_group:
5+
pull_request_target:
6+
types:
7+
- opened
8+
- reopened
9+
- edited
10+
- synchronize
11+
12+
permissions:
13+
pull-requests: read
14+
15+
jobs:
16+
conventional-title:
17+
name: Validate PR title is Conventional Commit
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check title
21+
if: github.event_name == 'pull_request_target'
22+
uses: amannn/action-semantic-pull-request@v5
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
types: |
27+
fix
28+
feat
29+
chore
30+

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release-please:
10+
name: Create Release
11+
outputs:
12+
release-pr: ${{ steps.release.outputs.pr }}
13+
tag-name: ${{ steps.release.outputs.tag_name }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Run release-please
17+
id: release
18+
uses: google-github-actions/release-please-action@v3
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
command: manifest

.github/workflows/test.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Noir tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
MINIMUM_NOIR_VERSION: v0.34.0
12+
13+
jobs:
14+
noir-version-list:
15+
name: Query supported Noir versions
16+
runs-on: ubuntu-latest
17+
outputs:
18+
noir_versions: ${{ steps.get_versions.outputs.versions }}
19+
20+
steps:
21+
- name: Checkout sources
22+
id: get_versions
23+
run: |
24+
# gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version.
25+
VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end')
26+
echo "versions=$VERSIONS"
27+
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
28+
env:
29+
GH_TOKEN: ${{ github.token }}
30+
31+
test:
32+
needs: [noir-version-list]
33+
name: Test on Nargo ${{matrix.toolchain}}
34+
runs-on: ubuntu-latest
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}}
39+
include:
40+
- toolchain: nightly
41+
steps:
42+
- name: Checkout sources
43+
uses: actions/checkout@v4
44+
45+
- name: Install Nargo
46+
uses: noir-lang/[email protected]
47+
with:
48+
toolchain: ${{ matrix.toolchain }}
49+
50+
- name: Run Noir tests
51+
run: nargo test
52+
53+
format:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout sources
57+
uses: actions/checkout@v4
58+
59+
- name: Install Nargo
60+
uses: noir-lang/[email protected]
61+
with:
62+
toolchain: ${{ env.MINIMUM_NOIR_VERSION }}
63+
64+
- name: Run formatter
65+
run: nargo fmt --check
66+
67+
# This is a job which depends on all test jobs and reports the overall status.
68+
# This allows us to add/remove test jobs without having to update the required workflows.
69+
tests-end:
70+
name: Noir End
71+
runs-on: ubuntu-latest
72+
# We want this job to always run (even if the dependant jobs fail) as we want this job to fail rather than skipping.
73+
if: ${{ always() }}
74+
needs:
75+
- test
76+
- format
77+
78+
steps:
79+
- name: Report overall success
80+
run: |
81+
if [[ $FAIL == true ]]; then
82+
exit 1
83+
else
84+
exit 0
85+
fi
86+
env:
87+
# We treat any cancelled, skipped or failing jobs as a failure for the workflow as a whole.
88+
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{".": "0.0.0"}

release-please-config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"release-type": "simple",
3+
"bump-minor-pre-major": true,
4+
"bump-patch-for-minor-pre-major": true,
5+
"pull-request-title-pattern": "chore: Release ${version}",
6+
"group-pull-request-title-pattern": "chore: Release ${version}",
7+
"packages": {
8+
".": {
9+
"release-type": "simple",
10+
"include-component-in-tag": false
11+
}
12+
},
13+
"plugins": [
14+
"sentence-case"
15+
]
16+
}

0 commit comments

Comments
 (0)