Skip to content

Commit cd94c98

Browse files
committed
Integrate Mayhem
1 parent 96ef91b commit cd94c98

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

.github/workflows/mayhem.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Mayhem
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
build:
13+
permissions: write-all
14+
name: '${{ matrix.os }} shared=${{ matrix.shared }} ${{ matrix.build_type }}'
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest]
19+
shared: [false]
20+
build_type: [Release]
21+
include:
22+
- os: ubuntu-latest
23+
triplet: x64-linux
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
with:
28+
submodules: recursive
29+
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Extract metadata (tags, labels) for Docker
38+
id: meta
39+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
40+
with:
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
43+
- name: Build and push Docker image
44+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
45+
with:
46+
file: ./Dockerfile.mayhem
47+
context: .
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}
51+
52+
- name: Start analysis
53+
uses: ForAllSecure/mcode-action@v1
54+
with:
55+
mayhem-token: ${{ secrets.MAYHEM_TOKEN }}
56+
args: --image ${{ steps.meta.outputs.tags }}
57+
sarif-output: sarif
58+
59+
- name: Upload SARIF file(s)
60+
uses: github/codeql-action/upload-sarif@v1
61+
with:
62+
sarif_file: sarif

Dockerfile.mayhem

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM --platform=linux/amd64 ubuntu:22.04
2+
3+
RUN apt-get update
4+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake python-is-python3
5+
6+
COPY . /repo
7+
WORKDIR /repo/build
8+
RUN cmake ..
9+
RUN make -j8

Mayhemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
project: pycdc
2+
target: pycdc
3+
image: ghcr.io/rnshah9/playground:pycdc
4+
5+
cmds:
6+
- cmd: /repo/build/pycdc @@

0 commit comments

Comments
 (0)