Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 32 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ jobs:
tags: p4lang/behavioral-model:test-build
build-args: IMAGE_TYPE=test
cache-from: type=gha
cache-to: type=gha,mode=max
# A cache write must not fail the build.
cache-to: type=gha,mode=max,ignore-error=true
- name: Run tests in Docker image
run: |
docker run --rm p4lang/behavioral-model:test-build \
Expand All @@ -60,14 +61,26 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push production image
- name: Build production image
uses: docker/build-push-action@v7
with:
context: .
load: true
tags: p4lang/behavioral-model:${{ steps.get-tag.outputs.tag }}
cache-from: type=gha
# A cache write must not fail the build.
cache-to: type=gha,mode=max,ignore-error=true
- name: Smoke test production image
run: |
docker run --rm p4lang/behavioral-model:${{ steps.get-tag.outputs.tag }} \
simple_switch --version
- name: Push production image
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: p4lang/behavioral-model:${{ steps.get-tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max

build-no-pi:
if: ${{ github.repository == 'p4lang/behavioral-model' && github.ref == 'refs/heads/main' }}
Expand All @@ -88,7 +101,8 @@ jobs:
tags: p4lang/behavioral-model:test-build-no-pi
build-args: IMAGE_TYPE=test
cache-from: type=gha
cache-to: type=gha,mode=max
# A cache write must not fail the build.
cache-to: type=gha,mode=max,ignore-error=true
- name: Run tests in Docker image
run: |
docker run --rm p4lang/behavioral-model:test-build-no-pi \
Expand All @@ -98,12 +112,24 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push no-PI production image
- name: Build no-PI production image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile.noPI
load: true
tags: p4lang/behavioral-model:no-pi
cache-from: type=gha
# A cache write must not fail the build.
cache-to: type=gha,mode=max,ignore-error=true
- name: Smoke test no-PI production image
run: |
docker run --rm p4lang/behavioral-model:no-pi simple_switch --version
- name: Push no-PI production image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile.noPI
push: true
tags: p4lang/behavioral-model:no-pi
cache-from: type=gha
cache-to: type=gha,mode=max
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

ARG PARENT_VERSION=latest-24
ARG PARENT_VERSION=latest
FROM p4lang/pi:${PARENT_VERSION}
LABEL maintainer="P4 Developers <p4-dev@lists.p4.org>"

Expand Down Expand Up @@ -33,10 +33,10 @@ ENV BM_DEPS build-essential \
libjsoncpp-dev \
libxxhash-dev \
pkg-config
ENV BM_RUNTIME_DEPS libboost-program-options1.74.0 \
libboost-system1.74.0 \
libboost-filesystem1.74.0 \
libboost-thread1.74.0 \
ENV BM_RUNTIME_DEPS libboost-program-options1.83.0 \
libboost-system1.83.0 \
libboost-filesystem1.83.0 \
libboost-thread1.83.0 \
libgmp10 \
libpcap0.8t64 \
libxxhash0 \
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile.noPI
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ ENV BM_DEPS build-essential \
libboost-thread-dev \
libjsoncpp-dev \
libxxhash-dev
ENV BM_RUNTIME_DEPS libboost-program-options1.74.0 \
libboost-system1.74.0 \
libboost-filesystem1.74.0 \
libboost-thread1.74.0 \
ENV BM_RUNTIME_DEPS libboost-program-options1.83.0 \
libboost-system1.83.0 \
libboost-filesystem1.83.0 \
libboost-thread1.83.0 \
libgmp10 \
libpcap0.8 \
libpcap0.8t64 \
libjsoncpp25 \
libxxhash0 \
python3 \
python3-six \
Expand Down
Loading