token #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mayhem (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: | |
# Avoid downloading Bazel every time. | |
bazelisk-cache: true | |
# Store build cache per workflow. | |
disk-cache: ${{ github.workflow }} | |
# Share repository cache between workflows. | |
repository-cache: true | |
- name: Run Bazel for Mayhem with Docker image | |
run: | | |
bazel run --define=MAYHEM_URL=${{ env.MAYHEM_URL }} //mayhem:push_fuzz_calculator_image | |
bazel build --define=MAYHEM_URL=${{ env.MAYHEM_URL }} //mayhem:run_fuzz_calculator | |
env: | |
MAYHEM_URL: ${{ env.MAYHEM_URL }} | |
MAYHEM_TOKEN: ${{ secrets.MAYHEM_TOKEN }} | |
- name: Run bazel for Mayhem package | |
run: | | |
bazel build --define=MAYHEM_URL=${{ env.MAYHEM_URL }} //mayhem:run_calculator | |
env: | |
MAYHEM_URL: ${{ env.MAYHEM_URL }} | |
MAYHEM_TOKEN: ${{ secrets.MAYHEM_TOKEN }} | |