-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.91 KB
/
linux.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
name: Mayhem on Linux (Bazel-based)
on:
push:
pull_request:
workflow_dispatch:
inputs:
mayhem_url:
description: 'Mayhem URL'
required: true
default: 'https://app.mayhem.security'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
MAYHEM_URL: ${{ github.event.inputs.mayhem_url || 'https://app.mayhem.security' }}
MAYHEM_TOKEN: ${{ secrets.MAYHEM_TOKEN }}
jobs:
build:
name: '${{ matrix.os }} shared=${{ matrix.shared }} ${{ matrix.build_type }}'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
shared: [false]
build_type: [Release]
include:
- os: ubuntu-latest
triplet: x64-linux
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Prep Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Bazel
uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Run Bazel for Mayhem with Docker image
run: |
bazel run --config=libfuzzer --action_env=MAYHEM_URL=${{ env.MAYHEM_URL }} --action_env=MAYHEM_TOKEN=${{ secrets.MAYHEM_TOKEN }} //mayhem:push_fuzz_calculator_image
bazel build --config=libfuzzer --action_env=MAYHEM_URL=${{ env.MAYHEM_URL }} --action_env=MAYHEM_TOKEN=${{ secrets.MAYHEM_TOKEN }} //mayhem:run_fuzz_calculator_image
env:
MAYHEM_URL: ${{ env.MAYHEM_URL }}
MAYHEM_TOKEN: ${{ secrets.MAYHEM_TOKEN }}
- name: Run bazel for Mayhem package
run: |
bazel build --action_env=MAYHEM_URL=${{ env.MAYHEM_URL }} --action_env=MAYHEM_TOKEN=${{ secrets.MAYHEM_TOKEN }} //mayhem:run_test_calculator_package
env:
MAYHEM_URL: ${{ env.MAYHEM_URL }}
MAYHEM_TOKEN: ${{ secrets.MAYHEM_TOKEN }}
# - name: Run coverage manually
# run: |
# bazel build --action_env=MAYHEM_URL=${{ env.MAYHEM_URL }} --action_env=MAYHEM_TOKEN=${{ secrets.MAYHEM_TOKEN }} //test:download_combined_test_calculator_results
# for test in $(ls ./bazel-bin/test/combined_test_calculator-pkg/testsuite); do bazel coverage --combined_report=lcov //test:combined_test_calculator --test_arg=test/combined_test_calculator-pkg/testsuite/$test; done
# env:
# MAYHEM_URL: ${{ env.MAYHEM_URL }}
# MAYHEM_TOKEN: ${{ secrets.MAYHEM_TOKEN }}