-
Notifications
You must be signed in to change notification settings - Fork 628
58 lines (48 loc) · 1.98 KB
/
master_fuzzer_binaries.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
name: Build fuzz targets from master
on:
push:
branches:
- master
jobs:
build_fuzzers:
name: Build Fuzzers
runs-on: "ubuntu-22.04-16core"
permissions:
contents: "read"
id-token: "write"
steps:
- run: sudo fallocate -l 128G /swap-file
- run: sudo chmod 600 /swap-file
- run: sudo mkswap /swap-file
- run: sudo swapon /swap-file
- name: Checkout
uses: actions/checkout@v4
- id: "auth"
name: Authenticate with Google Cloud
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: "projects/346595944828/locations/global/workloadIdentityPools/github-pool/providers/github-provider"
service_account: "github-service-account@nearone-clusterfuzz.iam.gserviceaccount.com"
- name: Installing nightly rust
run: |
rustup install nightly
rustup default nightly
- uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941
with:
crate: cargo-bolero
# TODO: remove the below once https://github.com/camshaft/bolero/pull/195 is released on crates.io
# and https://github.com/camshaft/bolero/pull/196 has a proper fix
git: https://github.com/near/bolero
rev: 1b43f78f25009695493b0e5fb72f9f82d1905845
- run: |
rustup target add --toolchain nightly wasm32-unknown-unknown
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
- name: "Set up GCP SDK"
uses: "google-github-actions/setup-gcloud@v1"
with:
version: ">= 416.0.0"
- name: "Compile fuzzers and upload to GCS"
run: |
NAME="nearcore-${{ github.ref_name }}-$(env TZ=Etc/UTC date +"%Y%m%d%H%M%S")"
RUSTFLAGS="--cfg fuzz" cargo +nightly bolero build-clusterfuzz --all-features --profile fuzz
gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://nearone_fuzzer_targets/${{ github.ref_name }}/$NAME.tar.gz"