-
Notifications
You must be signed in to change notification settings - Fork 338
131 lines (119 loc) · 4.11 KB
/
website-test.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: website-test
on:
merge_group:
pull_request:
branches: [main, "release-*"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# this is needed to gain access via OIDC to the S3 bucket for caching
permissions:
id-token: write
contents: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RISC0_TOOLCHAIN_VERSION: v2024-01-31.1
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
main: ${{ steps.filter.outputs.main }}
version-0_20: ${{ steps.filter.outputs.version-0_20 }}
steps:
- uses: actions/checkout@v4
- uses: risc0/paths-filter@4067d885736b84de7c414f582ac45897079b0a78
id: filter
with:
filters: |
main:
- rust-toolchain.toml
- .github/actions/**
- .github/workflows/website-test.yml
- bonsai/**
- risc0/**
- website/api/**
- website/doc-test/main/**
- website/docs/**
version-0_20:
- .github/actions/**
- .github/workflows/website-test.yml
- website/api_versioned_docs/version-0.20/**
- website/doc-test/version-0.20/**
# see: https://github.com/orgs/community/discussions/26822
doc-test:
if: always()
needs:
- main
- version-0_20
runs-on: ubuntu-latest
steps:
- name: Check all job status
# see https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
# see https://stackoverflow.com/a/67532120/4907315
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1
main:
if: needs.changes.outputs.main == 'true'
needs: changes
runs-on: [self-hosted, prod, Linux, cpu]
steps:
- uses: actions/checkout@v4
with:
# Recursive checkout required to build Solidity contracts and bindings.
submodules: recursive
- uses: ./.github/actions/rustup
- uses: ./.github/actions/sccache
with:
key: Linux-default
- uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f
with:
version: nightly-09fe3e041369a816365a020f715ad6f94dbce9f2
- uses: risc0/cargo-install@b9307573043522ab0d3e3be64a51763b765b52a4
with:
crate: cargo-binstall
version: "1.4"
- run: cargo binstall -y --force cargo-risczero@0.20
- run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: build
run: cargo test --release --no-run
working-directory: website/doc-test/main
- name: test
run: cargo test --release
working-directory: website/doc-test/main
- run: sccache --show-stats
version-0_20:
if: needs.changes.outputs.version-0_20 == 'true'
needs: changes
runs-on: [self-hosted, prod, Linux, cpu]
steps:
- uses: actions/checkout@v4
with:
# Recursive checkout required to build Solidity contracts and bindings.
submodules: recursive
- uses: ./.github/actions/rustup
- uses: ./.github/actions/sccache
with:
key: Linux-default
- uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f
with:
version: nightly-09fe3e041369a816365a020f715ad6f94dbce9f2
- uses: risc0/cargo-install@b9307573043522ab0d3e3be64a51763b765b52a4
with:
crate: cargo-binstall
version: "1.4"
- run: cargo binstall -y --force cargo-risczero@0.20
- run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: build
run: cargo test --release --no-run
working-directory: website/doc-test/version-0.20
- name: test
run: cargo test --release
working-directory: website/doc-test/version-0.20
- run: sccache --show-stats