forked from eclipse-zenoh/zenoh
-
Notifications
You must be signed in to change notification settings - Fork 2
159 lines (139 loc) · 5.14 KB
/
Copy pathfuzz-scheduled.yml
File metadata and controls
159 lines (139 loc) · 5.14 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#
# Copyright (c) 2026 ZettaScale Technology
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# ZettaScale Zenoh Team, <zenoh@zettascale.tech>
#
name: Scheduled Fuzzing
on:
schedule:
# Run the 1-hour campaign every day except Sunday.
- cron: "0 0 * * 1-6"
# Run the 5-hour campaign on Sunday instead of the daily run.
- cron: "0 0 * * 0"
workflow_dispatch:
inputs:
profile:
type: choice
description: Fuzzing duration profile
required: true
default: daily
options:
- daily
- weekly
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
NIGHTLY_TOOLCHAIN: nightly
jobs:
determine-profile:
name: Determine fuzzing profile
runs-on: ubuntu-latest
outputs:
label: ${{ steps.profile.outputs.label }}
max_total_time: ${{ steps.profile.outputs.max_total_time }}
steps:
- name: Select duration profile
id: profile
shell: bash
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
profile="${{ inputs.profile }}"
elif [[ "${{ github.event.schedule }}" == "0 0 * * 0" ]]; then
profile="weekly"
else
profile="daily"
fi
if [[ "$profile" == "weekly" ]]; then
echo "label=weekly" >> "$GITHUB_OUTPUT"
echo "max_total_time=18000" >> "$GITHUB_OUTPUT"
else
echo "label=daily" >> "$GITHUB_OUTPUT"
echo "max_total_time=3600" >> "$GITHUB_OUTPUT"
fi
fuzz-codec:
name: Codec fuzz (${{ needs.determine-profile.outputs.label }}) - ${{ matrix.target }}
needs: determine-profile
runs-on: ubuntu-latest
timeout-minutes: 330
strategy:
fail-fast: false
matrix:
target:
- transport_message
- network_message
- frame
- scouting_message
steps:
- name: Clone this repository
uses: actions/checkout@v4
- name: Install latest Rust toolchain
run: rustup toolchain install ${{ env.NIGHTLY_TOOLCHAIN }}
- name: Install cargo-fuzz
run: cargo +stable install --locked cargo-fuzz
- name: Setup rust-cache
uses: Swatinem/rust-cache@v2
with:
cache-bin: false
workspaces: |
. -> target
commons/zenoh-codec/fuzz -> commons/zenoh-codec/fuzz/target
- name: Generate zenoh-codec seed corpora
run: cargo run --bin gen_all_corpora
working-directory: commons/zenoh-codec/fuzz
- name: Verify zenoh-codec seed corpora
run: cargo run --bin verify_all_corpora
working-directory: commons/zenoh-codec/fuzz
- name: Run codec fuzz target
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} fuzz run ${{ matrix.target }} -- -max_total_time=${{ needs.determine-profile.outputs.max_total_time }}
working-directory: commons/zenoh-codec/fuzz
- name: Upload codec fuzz artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: fuzz-artifacts-codec-${{ needs.determine-profile.outputs.label }}-${{ matrix.target }}
path: commons/zenoh-codec/fuzz/artifacts/${{ matrix.target }}
if-no-files-found: ignore
retention-days: 14
fuzz-protocol:
name: Protocol fuzz (${{ needs.determine-profile.outputs.label }}) - endpoint_from_str
needs: determine-profile
runs-on: ubuntu-latest
timeout-minutes: 330
steps:
- name: Clone this repository
uses: actions/checkout@v4
- name: Install latest Rust toolchain
run: rustup toolchain install ${{ env.NIGHTLY_TOOLCHAIN }}
- name: Install cargo-fuzz
run: cargo +stable install --locked cargo-fuzz
- name: Setup rust-cache
uses: Swatinem/rust-cache@v2
with:
cache-bin: false
workspaces: |
. -> target
commons/zenoh-protocol/fuzz -> commons/zenoh-protocol/fuzz/target
- name: Generate endpoint_from_str seed corpus
run: cargo run --bin gen_endpoint_corpus
working-directory: commons/zenoh-protocol/fuzz
- name: Verify endpoint_from_str seed corpus
run: cargo run --bin verify_endpoint_corpus
working-directory: commons/zenoh-protocol/fuzz
- name: Run endpoint_from_str fuzz target
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} fuzz run endpoint_from_str -- -max_total_time=${{ needs.determine-profile.outputs.max_total_time }}
working-directory: commons/zenoh-protocol/fuzz
- name: Upload protocol fuzz artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: fuzz-artifacts-protocol-${{ needs.determine-profile.outputs.label }}-endpoint_from_str
path: commons/zenoh-protocol/fuzz/artifacts/endpoint_from_str
if-no-files-found: ignore
retention-days: 14