Skip to content

update rules mayhem #154

update rules mayhem

update rules mayhem #154

Workflow file for this run

name: Mayhem on Windows (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: [windows-latest]
shared: [false]
build_type: [Release]
include:
- os: windows-latest
triplet: x64-windows
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Prep Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Bazel
uses: bazel-contrib/setup-bazel@0.18.0
- name: Log into Mayhem
run: |
echo %USERPROFILE%
mkdir "%USERPROFILE%\.config\mayhem"
echo %USERPROFILE%
echo [DEFAULT]> "%USERPROFILE%\.config\mayhem\mayhem"
echo version=0>> "%USERPROFILE%\.config\mayhem\mayhem"
echo url=%MAYHEM_URL%>> "%USERPROFILE%\.config\mayhem\mayhem"
echo token=%MAYHEM_TOKEN%>> "%USERPROFILE%\.config\mayhem\mayhem"
echo XDG_CONFIG_HOME=%USERPROFILE%/.config>> "%GITHUB_ENV%"
shell: cmd
env:
MAYHEM_URL: ${{ env.MAYHEM_URL }}
MAYHEM_TOKEN: ${{ secrets.MAYHEM_TOKEN }}
- name: Add Windows-specific .bazelrc setting
run: |
powershell -Command "(Get-Content .bazelrc) | ForEach-Object { $_; if ($_ -match '# Windows stuff') { 'startup --output_user_root=C:/tmp' } } | Set-Content .bazelrc"
shell: cmd
- name: Run bazel for Mayhem package
run: |
bazel run //mayhem:run_test_calculator_package
shell: cmd
env:
MAYHEM_URL: ${{ env.MAYHEM_URL }}
XDG_CONFIG_HOME: ${{ env.XDG_CONFIG_HOME }}
# - name: Install LLVM
# run: |
# scripts\install_llvm.bat
# shell: cmd
# - name: Run bazel for Mayhem + libFuzzer
# run: |
# bazel clean --expunge
# set USE_CLANG_CL=1
# bazel build --compiler=clang-cl --config=libfuzzer //mayhem:run_package_fuzz_calculator
# - name: Run coverage manually
# run: |
# bazel build //test:download_combined_test_calculator_results
# for /f %%i in ('dir /b .\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/%%i
# env:
# MAYHEM_URL: ${{ env.MAYHEM_URL }}
# XDG_CONFIG_HOME: ${{ env.XDG_CONFIG_HOME }}