Skip to content
Merged
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
16 changes: 10 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Test
on: [push]

jobs:
pre-commit:
runs-on: ubuntu-latest
Expand All @@ -22,6 +23,7 @@ jobs:
compiler: [gcc]
gcc_version: [11, 12, 13]
bazel_config: [cpp23, opt]
proto_version: ['30.0']
exclude:
- bazel_mode: workspace
gcc_version: 11
Expand All @@ -39,6 +41,8 @@ jobs:
compiler: ${{ matrix.compiler }}
gcc_version: ${{ matrix.gcc_version }}
bazel_config: ${{ matrix.bazel_config }}
module_version: "proto${{ matrix.proto_version }}"
module_default: proto30.0

test-clang:
needs: [pre-commit, test-gcc]
Expand All @@ -49,9 +53,8 @@ jobs:
bazel_mode: [bzlmod]
compiler: [clang]
llvm_version: [20.1.0, 19.1.6, 17.0.4]
bazel_config: [asan, cpp23, opt, fastbuild]
bazel_config: [asan, cpp23, fastbuild, opt]
proto_version: ['30.0', '29.0', '28.0', '27.0']
module_default: ['proto30.0']
exclude:
- os: macos-latest
llvm_version: 17.0.4
Expand Down Expand Up @@ -116,10 +119,10 @@ jobs:
os: ${{ matrix.os }}
bazel_mode: ${{ matrix.bazel_mode }}
compiler: ${{ matrix.compiler }}
llvm_version: "${{ matrix.llvm_version }}"
llvm_version: ${{ matrix.llvm_version }}
bazel_config: ${{ matrix.bazel_config }}
module_version: "proto${{ matrix.proto_version }}"
module_default: "${{ matrix.module_default }}"
module_default: proto30.0

test-bcr:
needs: [pre-commit, test-gcc]
Expand All @@ -132,7 +135,7 @@ jobs:
gcc_version: [11]
llvm_version: [19.1.6]
bazel_config: [opt]
module_version: [proto27.0]
proto_version: ['27.0']
exclude:
- os: ubuntu-latest
compiler: native
Expand All @@ -148,7 +151,8 @@ jobs:
gcc_version: ${{ matrix.gcc_version }}
llvm_version: ${{ matrix.llvm_version }}
bazel_config: ${{ matrix.bazel_config }}
module_version: ${{ matrix.module_version }}
module_version: "proto${{ matrix.proto_version }}"
module_default: proto30.0

done:
needs: [pre-commit, test-gcc, test-clang, test-bcr]
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ jobs:
version: ${{inputs.gcc_version}}
platform: ${{runner.arch}}

- uses: actions/cache@v4
- uses: actions/cache/restore@v4
id: cache_restore
with:
path: "~/.cache/bazel"
key: ${{env.CACHE_KEY_PREFIX}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{env.CACHE_KEY_PREFIX}}-${{github.ref}}
${{env.CACHE_KEY_PREFIX}}-refs/heads/main
${{env.CACHE_KEY_PREFIX}}

- name: Build and Test
run: |
if [ "${{inputs.compiler}}:${{inputs.gcc_version}}" == "gcc:" ]; then
Expand Down Expand Up @@ -139,19 +141,20 @@ jobs:
echo "BAZEL_ARGS: ${BAZEL_ARGS[@]}"
bazel "${BAZEL_INIT[@]}" test "${BAZEL_ARGS[@]}" //...

cleanup:
runs-on: ubuntu-latest
continue-on-error: true
needs: test
steps:
- uses: actions/cache/save@v4
if: ${{!startsWith(github.ref, 'refs/tags/')}}
id: cache_save
with:
path: "~/.cache/bazel"
key: ${{env.CACHE_KEY_PREFIX}}-${{github.ref}}-${{github.sha}}

- name: Cleanup old caches
if: ${{!startsWith(github.ref, 'refs/tags/') && steps.cache_restore.outputs.cache-hit}}
run: |
set -euo pipefail

PREFIX="${{env.CACHE_KEY_PREFIX}}-${{github.ref}}"
echo "Fetching list of old caches for key prefix '${PREFIX}''..."
echo "Fetching list of old caches for key prefix '${PREFIX}'..."
cacheKeyList=$(gh cache list --limit 250 --json id,key,ref,createdAt --jq "map(select(.key|startswith(\"${PREFIX}\")))|sort_by(.createdAt)|.[:-1]|.[].id")

echo "Deleting caches..."
for cacheKey in ${cacheKeyList}; do
echo "Deleting cache: '${cacheKey}'"
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# 0.6.4

# 0.6.3

* Made macro `PARSE_TEXT_PROTO` issue a deprecation warning.
* Raised minimum zlib version when built with proto version 27.0 for MacOS.
* Enabled bazel layering_check.
* Enabled Bazel layering_check.

# 0.6.2

Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Due to flag and test references to the repo name we use the old name for now.
module(
name = "helly25_proto",
version = "0.6.3",
version = "0.6.4",
)

# For local development we include LLVM and Hedron-Compile-Commands.
Expand Down