From a5469e8ee692caa43432488bcd4851af1624214d Mon Sep 17 00:00:00 2001 From: "Dr. Patrick Urbanke" Date: Mon, 26 May 2025 08:43:26 +0200 Subject: [PATCH 1/4] Streamlined build pipelines; build on every push --- .github/workflows/linux-cxx23.yaml | 84 ------------------- .../{linux-cxx20.yaml => linux.yaml} | 25 +++++- .../{macos-cxx20.yaml => macos.yaml} | 4 +- .../{windows-cxx20.yaml => windows.yaml} | 4 +- 4 files changed, 25 insertions(+), 92 deletions(-) delete mode 100644 .github/workflows/linux-cxx23.yaml rename .github/workflows/{linux-cxx20.yaml => linux.yaml} (81%) rename .github/workflows/{macos-cxx20.yaml => macos.yaml} (98%) rename .github/workflows/{windows-cxx20.yaml => windows.yaml} (97%) diff --git a/.github/workflows/linux-cxx23.yaml b/.github/workflows/linux-cxx23.yaml deleted file mode 100644 index 0f8f80d55..000000000 --- a/.github/workflows/linux-cxx23.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: linux-cxx23 - -on: [ pull_request, workflow_dispatch ] - -env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - -jobs: - linux: - strategy: - fail-fast: false - matrix: - include: - - compiler: gcc - compiler-version: 13 - - compiler: gcc - compiler-version: 14 - name: "${{ github.job }} (${{ matrix.compiler }}-${{ matrix.compiler-version }})" - runs-on: ubuntu-24.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Setup ccache - uses: hendrikmuhs/ccache-action@v1 - with: - key: "${{ github.job }}-${{ matrix.compiler }}-${{ matrix.compiler-version }}" - max-size: "2G" - - name: Run vcpkg - uses: lukka/run-vcpkg@v11 - - name: Install dependencies - run: | - sudo apt update - sudo apt install -y ninja-build ${{ matrix.additional-dep }} - - name: Install Conan - run: | - sudo apt install -y pipx - pipx install conan - conan profile detect - - name: Make sure the library compiles with Conan - run: conan build . --build=missing -s compiler.cppstd=gnu23 -o *:with_capnproto=True -o *:with_cbor=True -o *:with_flatbuffers=True -o *:with_msgpack=True -o *:with_toml=True -o *:with_ubjson=True -o *:with_xml=True -o *:with_yaml=True - - name: Compile - run: | - if [[ "${{ matrix.compiler }}" == "llvm" ]]; then - export CC=clang-${{ matrix.compiler-version }} - export CXX=clang++-${{ matrix.compiler-version }} - elif [[ "${{ matrix.compiler }}" == "gcc" ]]; then - export CC=gcc-${{ matrix.compiler-version }} - export CXX=g++-${{ matrix.compiler-version }} - fi - sudo ln -s $(which ccache) /usr/local/bin/$CC - sudo ln -s $(which ccache) /usr/local/bin/$CXX - $CXX --version - cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=23 -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CAPNPROTO=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release -DREFLECTCPP_USE_STD_EXPECTED=ON - cmake --build build - - name: Run tests - run: | - ctest --test-dir build --output-on-failure - - name: Run benchmarks - run: | - echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY - echo '## Benchmarks across different formats' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_write >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_write >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_write >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - echo '## Benchmarks for JSON' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=canada >> $GITHUB_STEP_SUMMARY - ./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=licenses >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/linux-cxx20.yaml b/.github/workflows/linux.yaml similarity index 81% rename from .github/workflows/linux-cxx20.yaml rename to .github/workflows/linux.yaml index 78c176114..9da96f67b 100644 --- a/.github/workflows/linux-cxx20.yaml +++ b/.github/workflows/linux.yaml @@ -1,6 +1,6 @@ -name: linux-cxx20 +name: linux -on: [ pull_request, workflow_dispatch ] +on: [ push ] env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" @@ -13,16 +13,33 @@ jobs: include: - compiler: llvm compiler-version: 16 + cxx: 20 + - compiler: llvm + compiler-version: 17 + cxx: 20 - compiler: llvm compiler-version: 18 + cxx: 20 - compiler: gcc compiler-version: 11 additional-dep: "g++-11" + cxx: 20 - compiler: gcc compiler-version: 12 + cxx: 20 + - compiler: gcc + compiler-version: 13 + cxx: 20 + - compiler: gcc + compiler-version: 14 + cxx: 20 + - compiler: gcc + compiler-version: 13 + cxx: 23 - compiler: gcc compiler-version: 14 - name: "${{ github.job }} (${{ matrix.compiler }}-${{ matrix.compiler-version }})" + cxx: 23 + name: "${{ github.job }} ($C++{{cxx}}-${{ matrix.compiler }}-${{ matrix.compiler-version }})" runs-on: ubuntu-24.04 steps: - name: Checkout @@ -66,7 +83,7 @@ jobs: sudo ln -s $(which ccache) /usr/local/bin/$CC sudo ln -s $(which ccache) /usr/local/bin/$CXX $CXX --version - cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=20 -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CAPNPROTO=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CAPNPROTO=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release cmake --build build - name: Run tests run: | diff --git a/.github/workflows/macos-cxx20.yaml b/.github/workflows/macos.yaml similarity index 98% rename from .github/workflows/macos-cxx20.yaml rename to .github/workflows/macos.yaml index 59dcac767..982b53bca 100644 --- a/.github/workflows/macos-cxx20.yaml +++ b/.github/workflows/macos.yaml @@ -1,6 +1,6 @@ -name: macos-cxx20 +name: macos -on: [ pull_request, workflow_dispatch ] +on: [ push ] env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" diff --git a/.github/workflows/windows-cxx20.yaml b/.github/workflows/windows.yaml similarity index 97% rename from .github/workflows/windows-cxx20.yaml rename to .github/workflows/windows.yaml index 483e31a4e..2f869b2b7 100644 --- a/.github/workflows/windows-cxx20.yaml +++ b/.github/workflows/windows.yaml @@ -1,6 +1,6 @@ -name: windows-cxx20 +name: windows -on: [ pull_request, workflow_dispatch ] +on: [ push ] env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" From 6a02d70ec4a7b84cf1547cddf762916cde753e6e Mon Sep 17 00:00:00 2001 From: "Dr. Patrick Urbanke" Date: Mon, 26 May 2025 08:46:05 +0200 Subject: [PATCH 2/4] Fixed typo --- .github/workflows/linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 9da96f67b..126cb2940 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -39,7 +39,7 @@ jobs: - compiler: gcc compiler-version: 14 cxx: 23 - name: "${{ github.job }} ($C++{{cxx}}-${{ matrix.compiler }}-${{ matrix.compiler-version }})" + name: "${{ github.job }} ($C++${{ cxx }}-${{ matrix.compiler }}-${{ matrix.compiler-version }})" runs-on: ubuntu-24.04 steps: - name: Checkout From e882651cfbfae2ff2f5b6ba0396b7b55478a8e3a Mon Sep 17 00:00:00 2001 From: "Dr. Patrick Urbanke" Date: Mon, 26 May 2025 08:47:39 +0200 Subject: [PATCH 3/4] Fixed yet another typo --- .github/workflows/linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 126cb2940..e77eedff1 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -39,7 +39,7 @@ jobs: - compiler: gcc compiler-version: 14 cxx: 23 - name: "${{ github.job }} ($C++${{ cxx }}-${{ matrix.compiler }}-${{ matrix.compiler-version }})" + name: "${{ github.job }} ($C++${{ matrix.cxx }}-${{ matrix.compiler }}-${{ matrix.compiler-version }})" runs-on: ubuntu-24.04 steps: - name: Checkout From ea1044733c5af207dcce0f7fe91585e9484b726e Mon Sep 17 00:00:00 2001 From: "Dr. Patrick Urbanke" Date: Mon, 26 May 2025 08:48:44 +0200 Subject: [PATCH 4/4] Removed $ --- .github/workflows/linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index e77eedff1..598790018 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -39,7 +39,7 @@ jobs: - compiler: gcc compiler-version: 14 cxx: 23 - name: "${{ github.job }} ($C++${{ matrix.cxx }}-${{ matrix.compiler }}-${{ matrix.compiler-version }})" + name: "${{ github.job }} (C++${{ matrix.cxx }}-${{ matrix.compiler }}-${{ matrix.compiler-version }})" runs-on: ubuntu-24.04 steps: - name: Checkout