2023-05-16 19:05:31 +08:00
|
|
|
name: fedora-cmake
|
2022-01-04 21:07:37 +08:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: Release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2023-11-14 21:27:42 +08:00
|
|
|
- container: fedora:38
|
2022-03-02 19:06:40 +08:00
|
|
|
compiler: gcc
|
|
|
|
compiler-version: 11 # Only used in cache action so far
|
2022-02-14 21:56:49 +08:00
|
|
|
ignore-errors: true # Stack trace test fails on Fedora (issue #118)
|
2022-01-04 21:07:37 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
continue-on-error: ${{ matrix.ignore-errors }}
|
|
|
|
|
2022-02-14 21:56:49 +08:00
|
|
|
env:
|
|
|
|
RUN_CMD: docker exec --tty ${{matrix.compiler}}-build-container
|
2022-01-04 21:07:37 +08:00
|
|
|
|
|
|
|
steps:
|
2023-05-16 19:03:17 +08:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-04 21:07:37 +08:00
|
|
|
|
2022-03-02 19:06:40 +08:00
|
|
|
- name: Cache dependencies
|
2022-04-05 21:11:54 +08:00
|
|
|
uses: actions/cache@v3
|
2022-03-02 19:06:40 +08:00
|
|
|
with:
|
|
|
|
key: ${{matrix.container}}-${{matrix.compiler}}${{matrix.compiler-version}}
|
|
|
|
path: |
|
2022-04-05 21:11:54 +08:00
|
|
|
${{github.workspace}}/build/_deps
|
2022-03-02 19:06:40 +08:00
|
|
|
|
2022-02-14 21:56:49 +08:00
|
|
|
- name: Prepare container
|
|
|
|
# Note: For the sandbox tests to work, we need a privileged, unconfined
|
|
|
|
# container that retains its capabilities.
|
2022-01-04 21:07:37 +08:00
|
|
|
run: |
|
2022-02-14 21:56:49 +08:00
|
|
|
docker run --name ${{matrix.compiler}}-build-container \
|
|
|
|
--tty \
|
|
|
|
--privileged \
|
|
|
|
--cap-add ALL \
|
|
|
|
--security-opt apparmor:unconfined \
|
|
|
|
-v $GITHUB_WORKSPACE:$GITHUB_WORKSPACE \
|
|
|
|
-e TERM=dumb \
|
|
|
|
-e BUILD_TYPE \
|
|
|
|
-e GITHUB_WORKSPACE \
|
|
|
|
-d ${{matrix.container}} \
|
|
|
|
sleep infinity
|
2022-01-04 21:07:37 +08:00
|
|
|
|
2022-02-14 21:56:49 +08:00
|
|
|
- name: Install build tools
|
2022-01-04 21:07:37 +08:00
|
|
|
run: |
|
2022-02-14 21:56:49 +08:00
|
|
|
$RUN_CMD dnf update -y --quiet
|
2022-04-05 21:11:54 +08:00
|
|
|
$RUN_CMD dnf install -y --quiet \
|
|
|
|
git make automake patch glibc-static libstdc++-static cmake \
|
|
|
|
ninja-build python3 python3-pip clang-devel libcap-devel
|
2022-01-04 21:07:37 +08:00
|
|
|
|
|
|
|
- name: Create Build Environment
|
|
|
|
run: |
|
2023-11-14 23:20:32 +08:00
|
|
|
$RUN_CMD pip3 install --progress-bar=off absl-py 'clang>=13,<14'
|
2022-02-14 21:56:49 +08:00
|
|
|
$RUN_CMD cmake -E make_directory $GITHUB_WORKSPACE/build
|
2022-01-04 21:07:37 +08:00
|
|
|
|
|
|
|
- name: Configure CMake
|
2022-02-14 21:56:49 +08:00
|
|
|
run: |
|
2022-04-05 21:11:54 +08:00
|
|
|
$RUN_CMD cmake \
|
|
|
|
-S $GITHUB_WORKSPACE \
|
|
|
|
-B $GITHUB_WORKSPACE/build \
|
|
|
|
-G Ninja \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
2022-01-04 21:07:37 +08:00
|
|
|
|
|
|
|
- name: Build
|
2022-02-14 21:56:49 +08:00
|
|
|
run: |
|
2022-04-05 21:11:54 +08:00
|
|
|
$RUN_CMD cmake \
|
|
|
|
--build $GITHUB_WORKSPACE/build \
|
|
|
|
--config $BUILD_TYPE
|
2022-02-14 21:56:49 +08:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
2022-04-05 21:11:54 +08:00
|
|
|
$RUN_CMD ctest \
|
|
|
|
--test-dir $GITHUB_WORKSPACE/build \
|
|
|
|
-C $BUILD_TYPE \
|
2022-02-14 21:56:49 +08:00
|
|
|
--output-on-failure \
|
|
|
|
-R SapiTest
|