diff --git a/.github/workflows/ci-lint.yaml b/.github/workflows/ci-lint.yaml index c938f57718..be78dbb249 100644 --- a/.github/workflows/ci-lint.yaml +++ b/.github/workflows/ci-lint.yaml @@ -10,7 +10,7 @@ on: jobs: p4c-lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: IMAGE_TYPE: test CMAKE_ONLY: ON @@ -30,7 +30,7 @@ jobs: key: apply-linters-${{ runner.os }} max-size: 1000M - - name: Build (Ubuntu 20.04) + - name: Build (Ubuntu 22.04) run: | tools/ci-build.sh diff --git a/.github/workflows/ci-static-build-test.yml b/.github/workflows/ci-static-build-test.yml index 230a11d9cb..9fed61147c 100644 --- a/.github/workflows/ci-static-build-test.yml +++ b/.github/workflows/ci-static-build-test.yml @@ -15,7 +15,7 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: - # Build a p4c release on Ubuntu 20.04. + # Build a p4c release on Ubuntu 22.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') }} @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: dynamic: [{glibc: ON, stdlib: OFF}, {glibc: OFF, stdlib: ON}] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: IMAGE_TYPE: test CMAKE_UNITY_BUILD: ON @@ -46,7 +46,7 @@ jobs: max-size: 1000M - shell: bash - name: Build (Ubuntu 20.04) + name: Build (Ubuntu 22.04) run: | sudo -E tools/ci-build.sh ./tools/ci-check-static.sh ./build/p4c-bm2-ss ./build/p4c-dpdk ./build/p4c-ebpf \ diff --git a/.github/workflows/ci-test-debian.yml b/.github/workflows/ci-test-debian.yml index baeeb6f6ce..8645a72bd8 100644 --- a/.github/workflows/ci-test-debian.yml +++ b/.github/workflows/ci-test-debian.yml @@ -16,10 +16,22 @@ concurrency: jobs: # Build with GCC and test P4C on Ubuntu 22.04. test-ubuntu22: + name: test-ubuntu22 (Unity ${{ matrix.unity }}, GTest ${{ matrix.gtest }}) + strategy: + fail-fast: false + matrix: + unity: [ON, OFF] + include: + - unity: ON + gtest: ON + - unity: OFF + gtest: OFF runs-on: ubuntu-22.04 env: CTEST_PARALLEL_LEVEL: 4 IMAGE_TYPE: test + ENABLE_GTESTS: ${{ matrix.gtest }} + CMAKE_UNITY_BUILD: ${{ matrix.unity }} BUILD_GENERATOR: Ninja steps: - uses: actions/checkout@v4 @@ -30,7 +42,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1 with: - key: test-${{ runner.os }}-gcc + key: test-${{ matrix.unity }}-${{ runner.os }}-gcc max-size: 1000M - name: Build (Ubuntu 22.04, GCC) @@ -41,6 +53,7 @@ jobs: # Need to use sudo for the eBPF kernel tests and need to avoid p4tc_stf tests. run: sudo -E ctest --output-on-failure --schedule-random -E "p4tc_samples_stf|p4tc_cleanup|p4tc_setup" working-directory: ./build + if: matrix.unity == 'ON' && matrix.gtest == 'ON' # Build with GCC and test Tofino backend on Ubuntu 22.04. test-ubuntu22-tofino: @@ -79,44 +92,3 @@ jobs: - name: Run tests (Ubuntu 22.04) run: ctest --output-on-failure --schedule-random -R tofino working-directory: ./build - - # Build with GCC and test P4C on Ubuntu 20.04. - test-ubuntu20: - name: test-ubuntu20 (Unity ${{ matrix.unity }}, GTest ${{ matrix.gtest }}) - strategy: - fail-fast: false - matrix: - unity: [ON, OFF] - include: - - unity: ON - gtest: ON - - unity: OFF - gtest: OFF - runs-on: ubuntu-20.04 - env: - CTEST_PARALLEL_LEVEL: 4 - IMAGE_TYPE: test - ENABLE_GTESTS: ${{ matrix.gtest }} - CMAKE_UNITY_BUILD: ${{ matrix.unity }} - BUILD_GENERATOR: Ninja - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - - name: ccache - uses: hendrikmuhs/ccache-action@v1 - with: - key: test-${{ matrix.unity }}-${{ runner.os }}-gcc - max-size: 1000M - - - name: Build (Ubuntu 20.04, GCC) - run: | - tools/ci-build.sh - - - name: Run tests (Ubuntu 20.04) - # Need to use sudo for the eBPF kernel tests and need to avoid p4tc_stf tests. - run: sudo -E ctest --output-on-failure --schedule-random -E "p4tc_samples_stf|p4tc_cleanup|p4tc_setup" - working-directory: ./build - if: matrix.unity == 'ON' && matrix.gtest == 'ON' diff --git a/.github/workflows/ci-ubuntu-20-sanitizer-nightly.yml b/.github/workflows/ci-ubuntu-22-sanitizer-nightly.yml similarity index 81% rename from .github/workflows/ci-ubuntu-20-sanitizer-nightly.yml rename to .github/workflows/ci-ubuntu-22-sanitizer-nightly.yml index c5496e9e6b..cf6828f41a 100644 --- a/.github/workflows/ci-ubuntu-20-sanitizer-nightly.yml +++ b/.github/workflows/ci-ubuntu-22-sanitizer-nightly.yml @@ -1,4 +1,4 @@ -name: "test-p4c-ubuntu-20.04-sanitizers" +name: "test-p4c-ubuntu-22.04-sanitizers" on: schedule: @@ -10,11 +10,11 @@ on: branches: [main] jobs: - # Build with clang and test p4c on Ubuntu 20.04. - test-ubuntu20-clang-sanitizers: + # Build with clang and test p4c on Ubuntu 22.04. + test-ubuntu22-clang-sanitizers: # Only run on pull requests with the "run-sanitizer" label. if: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'run-sanitizer') }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: CTEST_PARALLEL_LEVEL: 2 IMAGE_TYPE: test @@ -34,11 +34,11 @@ jobs: key: test-${{ runner.os }}-clang max-size: 1000M - - name: Build (Ubuntu 20.04, Clang, Sanitizers) + - name: Build (Ubuntu 22.04, Clang, Sanitizers) run: | tools/ci-build.sh - - name: Run tests (Ubuntu 20.04) + - name: Run tests (Ubuntu 22.04) # Need to use sudo for the eBPF kernel tests. run: sudo -E ctest --output-on-failure --schedule-random -E "p4tc_samples_stf|p4tc_cleanup|p4tc_setup" working-directory: ./build diff --git a/README.md b/README.md index 580302a987..51bd893279 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ sudo dpkg -i /path/to/package.deb ``` 2. Install [dependencies](#dependencies). You can find specific instructions - for Ubuntu 20.04 [here](#ubuntu-dependencies) and for macOS 11 + for Ubuntu 22.04 [here](#ubuntu-dependencies) and for macOS 11 [here](#macos-dependencies). You can also look at the [CI installation script](https://github.com/p4lang/p4c/blob/main/tools/ci-build.sh). @@ -267,7 +267,7 @@ If you plan to contribute to P4C, you'll find more useful information ## Dependencies -Ubuntu 20.04 is the officially supported platform for P4C. There's also +Ubuntu 22.04 is the officially supported platform for P4C. There's also unofficial support for macOS 11. Other platforms are untested; you can try to use them, but YMMV. @@ -332,7 +332,7 @@ git clone --depth 1 -b v2.3.4 https://github.com/jothepro/doxygen-awesome-css ./ ``` `P4C` also depends on Google Protocol Buffers (Protobuf). `P4C` requires version -3.0 or higher, so the packaged version provided in Ubuntu 20.04 **should** +3.0 or higher, so the packaged version provided in Ubuntu 22.04 **should** work. However, P4C typically installs its own version of Protobuf using CMake's `FetchContent` module (at the moment, 3.25.3). If you are experiencing issues with the Protobuf version shipped with your OS distribution, we recommend that to install Protobuf 3.25.3 from source. You can find instructions [here](https://github.com/protocolbuffers/protobuf/blob/v3.25.3/src/README.md).