-
Notifications
You must be signed in to change notification settings - Fork 513
160 lines (151 loc) · 4.81 KB
/
fuzz_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
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
160
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Fuzz Test
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- "core/src/**"
- "core/fuzz/**"
- "!core/src/docs/**"
- "!core/src/services/**"
- "core/src/services/fs/**"
- "core/src/services/memory/**"
- "core/src/services/s3/**"
- ".github/workflows/fuzz_test.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
fuzz-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- name: Install libfuzz
shell: bash
run: sudo apt-get install -y libfuzzer-14-dev
- name: Install cargo fuzz
shell: bash
run: rustup install nightly && cargo +nightly install cargo-fuzz
- name: Build Fuzz Targets
shell: bash
working-directory: core/fuzz
run: cargo +nightly fuzz build
env:
CUSTOM_LIBFUZZER_PATH: /usr/lib/llvm-14/lib/libFuzzer.a
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: fuzz_targets
path: |
./target/x86_64-unknown-linux-gnu/release/fuzz_reader
./target/x86_64-unknown-linux-gnu/release/fuzz_writer
fuzz-test-s3:
runs-on: ubuntu-latest
needs: fuzz-build
services:
minio:
image: wktk/minio-server
ports:
- 9000:9000
env:
MINIO_ACCESS_KEY: "minioadmin"
MINIO_SECRET_KEY: "minioadmin"
strategy:
fail-fast: true
matrix:
fuzz-targets: [fuzz_reader, fuzz_writer]
steps:
- name: Install libfuzzer
run: sudo apt-get install -y libfuzzer-14-dev
- name: Setup Test Bucket
env:
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"
AWS_EC2_METADATA_DISABLED: "true"
run: aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test
- name: Download Fuzz Targets
uses: actions/download-artifact@v3
with:
name: fuzz_targets
path: ./target
- name: Grant Execute Permissions
shell: bash
run: chmod +x ./target/${{ matrix.fuzz-targets }}
- name: Run Fuzz Test
shell: bash
run: ./target/${{ matrix.fuzz-targets }} -max_total_time=120
env:
OPENDAL_S3_TEST: on
OPENDAL_S3_BUCKET: test
OPENDAL_S3_ENDPOINT: "http://127.0.0.1:9000"
OPENDAL_S3_ACCESS_KEY_ID: minioadmin
OPENDAL_S3_SECRET_ACCESS_KEY: minioadmin
OPENDAL_S3_REGION: us-east-1
fuzz-test-fs:
runs-on: ubuntu-latest
needs: fuzz-build
strategy:
fail-fast: true
matrix:
fuzz-targets: [fuzz_reader, fuzz_writer]
steps:
- name: Install libfuzzer
run: sudo apt-get install -y libfuzzer-14-dev
- name: Download Fuzz Targets
uses: actions/download-artifact@v3
with:
name: fuzz_targets
path: ./target
- name: Grant Execute Permissions
shell: bash
run: chmod +x ./target/${{ matrix.fuzz-targets }}
- name: Run Fuzz Test
shell: bash
run: ./target/${{ matrix.fuzz-targets }} -max_total_time=120
env:
OPENDAL_FS_TEST: on
OPENDAL_FS_ROOT: ${{ runner.temp }}/
fuzz-test-memory:
runs-on: ubuntu-latest
needs: fuzz-build
strategy:
fail-fast: true
matrix:
fuzz-targets: [fuzz_reader, fuzz_writer]
steps:
- name: Install libfuzzer
run: sudo apt-get install -y libfuzzer-14-dev
- name: Download Fuzz Targets
uses: actions/download-artifact@v3
with:
name: fuzz_targets
path: ./target
- name: Grant Execute Permissions
shell: bash
run: chmod +x ./target/${{ matrix.fuzz-targets }}
- name: Run Fuzz Test
shell: bash
run: ./target/${{ matrix.fuzz-targets }} -max_total_time=120
env:
OPENDAL_MEMORY_TEST: on