bet(build): try to build binaries #2758
Workflow file for this run
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
# SPDX-License-Identifier: MIT | |
# | |
# Copyright (c) 2024 Berachain Foundation | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without | |
# restriction, including without limitation the rights to use, | |
# copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the | |
# Software is furnished to do so, subject to the following | |
# conditions: | |
# | |
# The above copyright notice and this permission notice shall be | |
# included in all copies or substantial portions of the Software. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | |
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | |
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | |
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |
# OTHER DEALINGS IN THE SOFTWARE. | |
name: pipeline | |
on: | |
pull_request: | |
paths-ignore: | |
- "vercel.json" | |
- "docs/**" | |
merge_group: | |
paths-ignore: | |
- "vercel.json" | |
- "docs/**" | |
concurrency: | |
group: ci-${{ github.ref }}-tests | |
# We don't want to cancel in progress on main. This is to allow | |
# us to debug main if a bad commit is pushed. | |
# Case 1: The base branch is main and the event triggered via merge group => we DO NOT want to cancel in progress | |
# Case 2: The reference branch is not main => we want to cancel in progress | |
cancel-in-progress: ${{ !(github.base_ref == 'refs/heads/main' && github.event_name == 'merge_group') || github.ref != 'refs/heads/main' }} | |
jobs: | |
ci: | |
strategy: | |
matrix: | |
args: | |
- "build" | |
- "lint" | |
- "slither" | |
- "gosec" | |
- "nilaway" | |
- "generate-check" | |
- "test-unit-cover" | |
- "test-unit-fuzz" | |
- "test-forge-cover" | |
- "test-forge-fuzz" | |
- "test-e2e" | |
os: [ubuntu-latest-large] | |
name: ${{ matrix.args }} | |
runs-on: | |
labels: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
if: ${{ matrix.args == 'lint' || matrix.args == 'generate-check' || matrix.args == 'test-forge-cover' || matrix.args == 'test-forge-fuzz' || matrix.args == 'test-e2e' }} | |
- name: Setup Golang | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "stable" | |
check-latest: true | |
if: ${{ !(matrix.args == 'test-forge-cover' || matrix.args == 'test-forge-fuzz') }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
if: ${{ matrix.args == 'test-e2e' }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
if: ${{ matrix.args == 'test-e2e' }} | |
- name: Install Kurtosis | |
run: | | |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list | |
sudo apt update | |
sudo apt install kurtosis-cli=$(grep github.com/kurtosis-tech/kurtosis/api/golang go.mod | awk '{print $2}' | sed 's/^v//') -y | |
kurtosis engine start | |
if: ${{ matrix.args == 'test-e2e' }} | |
- name: Run ${{ matrix.args }} | |
run: | | |
make ${{ matrix.args }} | |
env: | |
GOPATH: /home/runner/go | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./${{ matrix.args }}.txt | |
if: ${{ matrix.args == 'test-unit-cover' || matrix.args == 'test-forge-cover'}} |