Skip to content

static-build-test-p4c #127

static-build-test-p4c

static-build-test-p4c #127

name: "static-build-test-p4c"
on:
schedule:
# Every day on midnight UTC
- cron: "0 0 * * *"
push:
branches: [main]
pull_request:
branches: [main]
# Cancel any preceding run on the pull request.
concurrency:
group: static-build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
# Build a p4c release on Ubuntu 20.04.
build-linux:
# Only run on pull requests with the "run-static" label.
if: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'run-static') }}
# Note: Actions have no real ternary condition operator, but this hack works because non-empty
# strings are true.
name: Dynamic ${{ matrix.dynamic.glibc == 'ON' && 'glibc' || 'stdlib' }}
strategy:
fail-fast: false
matrix:
dynamic: [{glibc: ON, stdlib: OFF}, {glibc: OFF, stdlib: ON}]
runs-on: ubuntu-20.04
env:
IMAGE_TYPE: test
CMAKE_UNITY_BUILD: ON
STATIC_BUILD_WITH_DYNAMIC_GLIBC: "${{ matrix.dynamic.glibc }}"
STATIC_BUILD_WITH_DYNAMIC_STDLIB: "${{ matrix.dynamic.stdlib }}"
ENABLE_TEST_TOOLS: ON
BUILD_GENERATOR: Ninja
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: test-static-${{ runner.os }}
max-size: 1000M
- shell: bash
name: Build (Ubuntu 20.04)
run: |
sudo -E tools/ci-build.sh
./tools/ci-check-static.sh ./build/p4c-bm2-ss ./build/p4c-dpdk ./build/p4c-ebpf \
./build/p4c-pna-p4tc ./build/p4c-ubpf ./build/p4test ./build/p4testgen