Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows
diff options
context:
space:
mode:
authorLeitwolf112026-09-28 01:10:14 +0300
committerLeitwolf112026-09-28 01:10:14 +0300
commit97328fefe9650c84b594f1cea212c48562e1745b (patch)
tree8905f56f9a2f337637d6ed9c86675b52829239b5 /.github/workflows
parentfbd2ec1c12c3ea39df0b7af01b6ab11360302299 (diff)
downloadcatch3-97328fefe9650c84b594f1cea212c48562e1745b.tar.gz
Harden Catch3 exit guards and pin build workflows
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/alternative-build-systems.yml13
-rw-r--r--.github/workflows/bazel-builds.yml37
-rw-r--r--.github/workflows/codeql.yml2
-rw-r--r--.github/workflows/coverage.yml34
-rw-r--r--.github/workflows/mac-builds.yml5
-rw-r--r--.github/workflows/mac-sanitizer-builds.yml12
-rw-r--r--.github/workflows/meson-builds.yml9
-rw-r--r--.github/workflows/package-manager-builds.yaml11
-rw-r--r--.github/workflows/validate-header-guards.yml9
-rw-r--r--.github/workflows/windows-simple-builds.yml5
10 files changed, 109 insertions, 28 deletions
diff --git a/.github/workflows/alternative-build-systems.yml b/.github/workflows/alternative-build-systems.yml
index 114d512e..30e59847 100644
--- a/.github/workflows/alternative-build-systems.yml
+++ b/.github/workflows/alternative-build-systems.yml
@@ -2,6 +2,9 @@ name: Alternative Build Systems
on: [push, pull_request]
+permissions:
+ contents: read
+
jobs:
xmake:
name: Xmake on ${{ matrix.os }}
@@ -12,9 +15,9 @@ jobs:
os: [windows-2025, macos-15]
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- - uses: xmake-io/github-action-setup-xmake@v1
+ - uses: xmake-io/github-action-setup-xmake@3a1a5dddfc7fa625d9a698738334bf55655a861a # v1
with:
xmake-version: '3.1.1'
@@ -36,13 +39,13 @@ jobs:
os: [windows-2022, macos-15]
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- - uses: abel0b/setup-premake@v2.4
+ - uses: abel0b/setup-premake@b80dc6f70e8ab159fb854bdadbeb1a53cfc28723 # v2.4
with:
version: '5.0.0-beta7'
- - uses: microsoft/setup-msbuild@v3
+ - uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3
if: runner.os == 'Windows'
with:
msbuild-architecture: x64
diff --git a/.github/workflows/bazel-builds.yml b/.github/workflows/bazel-builds.yml
new file mode 100644
index 00000000..459c4db0
--- /dev/null
+++ b/.github/workflows/bazel-builds.yml
@@ -0,0 +1,37 @@
+# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
+# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1
+
+name: Bazel Builds
+
+on: [push, pull_request]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ name: Bazel on ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [windows-2025, macos-15]
+
+ steps:
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+
+ - uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
+ with:
+ bazelisk-cache: true
+ repository-cache: true
+
+ - name: Run Progmasoft property tests on Windows
+ if: runner.os == 'Windows'
+ run: bazel test tests/Progmasoft:property_tests
+ shell: bash
+ env:
+ BAZEL_SH: C:\Program Files\Git\bin\bash.exe
+
+ - name: Run Progmasoft property tests on macOS
+ if: runner.os == 'macOS'
+ run: bazel test tests/Progmasoft:property_tests
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index a9f409f0..223f5eee 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -20,7 +20,7 @@ jobs:
matrix:
language: [actions, c-cpp]
steps:
- - uses: actions/checkout@v7
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: github/codeql-action/init@7999b86c43a865dc79d8923397f35af22de63401 # v4
with:
languages: ${{ matrix.language }}
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 4241f9a1..b1f72428 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -11,14 +11,15 @@ on:
permissions:
contents: read
- id-token: write
jobs:
- clang:
+ coverage:
runs-on: macos-latest
timeout-minutes: 40
+ permissions:
+ contents: read
steps:
- - uses: actions/checkout@v7
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Configure Clang coverage build
run: >-
cmake --preset basic-tests -G Ninja
@@ -40,9 +41,32 @@ jobs:
build/tests/SelfTest \
-object=build/tests/ProgmasoftSelfTest \
> catch3.lcov
- - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
+
+ - name: Upload coverage artifact for Codecov
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ with:
+ name: catch3-native-coverage
+ path: catch3.lcov
+ if-no-files-found: error
+ retention-days: 1
+
+ codecov:
+ needs: coverage
+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
+ runs-on: ubuntu-latest
+ permissions:
+ id-token: write
+ steps:
+ - name: Download coverage artifact
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: catch3-native-coverage
+ path: coverage
+
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
use_oidc: true
- files: catch3.lcov
+ files: coverage/catch3.lcov
flags: catch3-native
fail_ci_if_error: true
diff --git a/.github/workflows/mac-builds.yml b/.github/workflows/mac-builds.yml
index 2262d0bf..d3e9e906 100644
--- a/.github/workflows/mac-builds.yml
+++ b/.github/workflows/mac-builds.yml
@@ -2,6 +2,9 @@ name: Mac Builds
on: [push, pull_request]
+permissions:
+ contents: read
+
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
@@ -17,7 +20,7 @@ jobs:
std: [14, 17]
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Configure
run: |
diff --git a/.github/workflows/mac-sanitizer-builds.yml b/.github/workflows/mac-sanitizer-builds.yml
index 388afed2..953d0cf7 100644
--- a/.github/workflows/mac-sanitizer-builds.yml
+++ b/.github/workflows/mac-sanitizer-builds.yml
@@ -2,6 +2,9 @@ name: Mac Sanitizer Builds
on: [push, pull_request]
+permissions:
+ contents: read
+
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
@@ -25,12 +28,13 @@ jobs:
filter:
steps:
- - uses: actions/checkout@v6
-
- - name: Configure
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+ - name: Configure with the selected sanitizers
+ env:
+ CXXFLAGS: -fsanitize=${{ matrix.sanitizer }},undefined
+ LDFLAGS: -fsanitize=${{ matrix.sanitizer }},undefined
run: |
- CFXXFLAGS=-fsanitize=${{matrix.sanitizer}},undefined
cmake --preset ${{matrix.preset}} -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
diff --git a/.github/workflows/meson-builds.yml b/.github/workflows/meson-builds.yml
index e7ff79af..bf116da3 100644
--- a/.github/workflows/meson-builds.yml
+++ b/.github/workflows/meson-builds.yml
@@ -2,6 +2,9 @@ name: Meson Builds
on: [push, pull_request]
+permissions:
+ contents: read
+
jobs:
build:
name: Meson on ${{ matrix.os }}
@@ -12,14 +15,14 @@ jobs:
os: [windows-2025, macos-15]
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- - uses: actions/setup-python@v6
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.14'
- name: Install Meson and Ninja
- run: python -m pip install meson ninja
+ run: python -m pip install --requirement requirements-meson.txt
- name: Configure with Clang-CL on Windows
if: runner.os == 'Windows'
diff --git a/.github/workflows/package-manager-builds.yaml b/.github/workflows/package-manager-builds.yaml
index 3041f5f1..8754a7c1 100644
--- a/.github/workflows/package-manager-builds.yaml
+++ b/.github/workflows/package-manager-builds.yaml
@@ -2,23 +2,24 @@ name: Package Manager Builds
on: [push, pull_request]
+permissions:
+ contents: read
+
jobs:
conan_builds:
- name: Conan ${{matrix.conan_version}}
+ name: Conan on ${{ matrix.os }}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
# Conan's detected MSVC runtime targets the VS 2022 (v143) toolset.
os: [macos-15, windows-2022]
- conan_version:
- - '2.31.1'
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Install conan
- run: pip install conan==${{matrix.conan_version}}
+ run: python -m pip install --requirement requirements-conan.txt
- name: Detect a Clang-based Conan profile
run: conan profile detect --force
diff --git a/.github/workflows/validate-header-guards.yml b/.github/workflows/validate-header-guards.yml
index 98641b89..9b85a912 100644
--- a/.github/workflows/validate-header-guards.yml
+++ b/.github/workflows/validate-header-guards.yml
@@ -2,6 +2,9 @@ name: Check header guards
on: [push, pull_request]
+permissions:
+ contents: read
+
jobs:
build:
# Set the type of machine to run on
@@ -9,14 +12,14 @@ jobs:
steps:
- name: Checkout source code
- uses: actions/checkout@v6
+ uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Setup Dependencies
- uses: actions/setup-python@v6
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.12'
- name: Install checkguard
- run: pip install guardonce
+ run: python -m pip install --requirement requirements-header-guards.txt
- name: Check that include guards are properly named
run: |
diff --git a/.github/workflows/windows-simple-builds.yml b/.github/workflows/windows-simple-builds.yml
index 0caeb6b1..2f244b32 100644
--- a/.github/workflows/windows-simple-builds.yml
+++ b/.github/workflows/windows-simple-builds.yml
@@ -2,6 +2,9 @@ name: Windows Builds (Basic)
on: [push, pull_request]
+permissions:
+ contents: read
+
env:
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
@@ -18,7 +21,7 @@ jobs:
build_type: [Debug, Release]
std: [14, 17]
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Configure build
run: |