-
Notifications
You must be signed in to change notification settings - Fork 11
109 lines (92 loc) · 3.35 KB
/
build_test_deploy_wafl.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
name: Build, test and deploy WAFL
on:
push:
branches:
- master
paths:
- "wasm-fuzzer/**"
- ".github/**"
jobs:
local:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: "true"
- name: Install AFL dependencies & supervisord
run: |
sudo apt-get update
sudo apt-get install -y supervisor build-essential automake libtool-bin python3-dev git automake flex bison libglib2.0-dev libpixman-1-dev clang python3-setuptools llvm procps tree
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: "11" # The JDK version to make available on the path.
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
#architecture: x64 # (x64 or x86) - defaults to x64
# - name: Build SWAM
# run: |
# cd wasm-fuzzer/fuzzing-server-swam
# ./millw cli.assembly
# ./millw cli_server.assembly
- name: Download SWAM
run: |
cd wasm-fuzzer/fuzzing-server-swam
curl -o swam_cli.jar -L https://github.com/KTH/swam/releases/download/v0.6.0-RC3/swam_cli.jar
curl -o swam_server.jar -L https://github.com/KTH/swam/releases/download/v0.6.0-RC3/swam_server.jar
- name: Build Interface
run: |
bash ./wasm-fuzzer/fuzzing-client-afl/build_interface.sh
tree ${PWD}/wasm-fuzzer/wafl-temp
- name: Build AFL
run: |
bash ./wasm-fuzzer/fuzzing-client-afl/build_afl.sh
tree ${PWD}/wasm-fuzzer/wafl-temp
- name: Test wafl
run: |
tree ${PWD}/wasm-fuzzer/wafl-temp
cd wasm-fuzzer
bash test_wafl_local.sh ${PWD}/sample-testing-targets/branches2.wasm a 11
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- id: cache-docker-save
uses: actions/cache@v1
with:
path: /tmp/docker-save
key: docker-save-${{ hashFiles('./wasm-fuzzer/Dockerfile') }}
- if: steps.cache-docker-save.outputs.cache-hit == 'true'
run: docker load --input /tmp/docker-save/wafl.tar || true
- name: Build wafl image
run: |
cd wasm-fuzzer
docker --version
docker build -t wafl -f Dockerfile .
- name: Save Docker images to cache
if: steps.cache-docker-save.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/docker-save &&
docker save \
wafl $(docker history -q wafl | grep -v "<missing>") \
--output /tmp/docker-save/wafl.tar &&
ls -l /tmp/docker-save
- name: Point to sample-testing-targets in envs
run: |
cd wasm-fuzzer
sed --in-place "s|LOCAL_WASM_DIR=.*|LOCAL_WASM_DIR=${PWD}/sample-testing-targets|g" ${PWD}/.env
- name: Test wafl image
run: wasm-fuzzer/test_wafl_image.sh branches2.wasm a 11
- name: Test multi-processing.sh
run: |
wasm-fuzzer/multi-processing.sh 3 branches2.wasm a 11
sleep 3m
- name: Push images
run: |
docker tag wafl slumps/wafl:latest
docker login -u="$user" -p="$pass"
docker push slumps/wafl:latest
env:
user: ${{secrets.DOCKER_USER}}
pass: ${{secrets.DOCKER_PASS}}