diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index 5d004e8..47fe577 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -3,8 +3,10 @@ matrix: - 7.x - 8.x platform: - - ubuntu2404 - - macos + - debian11 + - ubuntu2404 + - macos + - windows tasks: verify_targets: name: Verify build targets diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 76ec374..2958c7c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: os: [ubuntu-latest] bazel_mode: [bzlmod, workspace] compiler: [gcc] - gcc_version: [11, 12, 13] + gcc_version: [11, 12, 13, 14] bazel_config: [cpp23, opt] proto_version: ['30.0'] exclude: @@ -29,13 +29,40 @@ jobs: gcc_version: 11 - bazel_mode: workspace gcc_version: 13 + - bazel_mode: workspace + gcc_version: 14 - bazel_config: cpp23 gcc_version: 11 - bazel_config: cpp23 gcc_version: 12 + - bazel_config: cpp23 + gcc_version: 13 + + uses: ./.github/workflows/test.yml + with: + os: ${{ matrix.os }} + bazel_mode: ${{ matrix.bazel_mode }} + compiler: ${{ matrix.compiler }} + gcc_version: ${{ matrix.gcc_version }} + bazel_config: ${{ matrix.bazel_config }} + module_version: "proto${{ matrix.proto_version }}" + module_default: proto30.0 + + test-windows: + needs: pre-commit + secrets: inherit + strategy: + matrix: + os: [windows-latest] + bazel_mode: [bzlmod] + compiler: [mingw, native] + gcc_version: [''] + bazel_config: [opt] + proto_version: ['30.0'] uses: ./.github/workflows/test.yml with: + continue-on-error: true os: ${{ matrix.os }} bazel_mode: ${{ matrix.bazel_mode }} compiler: ${{ matrix.compiler }} @@ -155,7 +182,7 @@ jobs: module_default: proto30.0 done: - needs: [pre-commit, test-gcc, test-clang, test-bcr] + needs: [pre-commit, test-bcr, test-clang, test-gcc, test-windows] runs-on: ubuntu-latest steps: - name: Done diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 70a2783..6a1a62a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,12 +65,15 @@ jobs: steps: - uses: actions/checkout@v4 - uses: bazelbuild/setup-bazelisk@v3 + - uses: egor-tensin/setup-mingw@v2 + if: ${{inputs.compiler == 'mingw' && startsWith(inputs.os, 'windows')}} + with: + platform: ${{runner.arch}} - uses: egor-tensin/setup-gcc@v1 - if: ${{inputs.compiler == 'gcc' && inputs.gcc_version != ''}} + if: ${{inputs.compiler == 'gcc' && inputs.gcc_version != '' && !startsWith(inputs.os, 'windows')}} with: version: ${{inputs.gcc_version}} platform: ${{runner.arch}} - - uses: actions/cache/restore@v4 id: cache_restore with: @@ -81,7 +84,9 @@ jobs: ${{env.CACHE_KEY_PREFIX}}-refs/heads/main ${{env.CACHE_KEY_PREFIX}} + - name: Build and Test + shell: bash run: | if [ "${{inputs.compiler}}:${{inputs.gcc_version}}" == "gcc:" ]; then echo "ERROR: When compiler=='gcc', then a valid 'compiler_version' must be given." @@ -114,7 +119,7 @@ jobs: elif [ "${{inputs.compiler}}" == "gcc" ]; then export CC=/usr/local/bin/gcc export CXX=/usr/local/bin/g++ - elif [ "${{inputs.compiler}}" == "native" ]; then + elif [ "${{inputs.compiler}}" == "mingw" ] || [ "${{inputs.compiler}}" == "native" ]; then # Use whatever is found! [ -n "${CC}" ] && [ -x "${CC}" ] && echo "CC: $(${CC} --version)" [ -n "${CXX}" ] && [ -x "${CXX}" ] && echo "CXX: $(${CXX} --version)" @@ -149,7 +154,7 @@ jobs: 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}} + if: ${{!startsWith(github.ref, 'refs/tags/') && steps.cache_restore.outputs.cache-hit && !startsWith(inputs.os, 'windows')}} run: | set -euo pipefail PREFIX="${{env.CACHE_KEY_PREFIX}}-${{github.ref}}" diff --git a/CHANGELOG.md b/CHANGELOG.md index a4961f8..da28de5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # 1.2.1 +* Added windows and new gcc versions to release checks. + # 1.2.0 * Added std::optional variants for file reading. diff --git a/README.md b/README.md index 738074a..6314acf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ This package contains a collection of utilities around Google's [Protocolbuffer](https://github.com/protocolbuffers/protobuf). The functions offered in this packages are widely used across Google's C++ code base and have saved tens of thousands of engineering hours. Some of these functons were originally implemented by the author and later re-implemented or cloned (see below). -The project works with Google's proto library version 27, 28, 29 and 30. Packages are available at [Bazel Central Registry](https://registry.bazel.build/modules/helly25_proto) and [Github](https://github.com/helly25/proto/releases). +The project works with: +* Google's proto library version 27, 28, 29, 30 +* Operating system: MacOS, Ubuntu, Windows +* Compiler: GCC [11, 14], Clang [17.0.4, 20.1.0] + +Packages are available at [Bazel Central Registry](https://registry.bazel.build/modules/helly25_proto) and [Github](https://github.com/helly25/proto/releases). [![Test](https://github.com/helly25/proto/actions/workflows/main.yml/badge.svg)](https://github.com/helly25/proto/actions/workflows/main.yml) diff --git a/bazelmod/llvm.20.1.0.MODULE.bazel b/bazelmod/llvm.20.1.0.MODULE.bazel index cd3e540..3dfe70d 100644 --- a/bazelmod/llvm.20.1.0.MODULE.bazel +++ b/bazelmod/llvm.20.1.0.MODULE.bazel @@ -13,32 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -bazel_dep(name = "toolchains_llvm", version = "1.3.0") -git_override( - module_name = "toolchains_llvm", - commit = "e831f94a8b7f3a39391f5822adcab8e4d443c03b", # Add more tools by default (#463) - remote = "https://github.com/bazel-contrib/toolchains_llvm", -) +bazel_dep(name = "toolchains_llvm", version = "1.4.0") llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True) llvm.toolchain( name = "llvm_toolchain_llvm", llvm_version = "20.1.0", - sha256 = { - "darwin-aarch64": "2c42ec26ec50c4bf8b95585f762b9d2f5b385d170dee772d9c1d6c9a7190dcef", - "linux-aarch64": "9d1bbf3f6d4d011e3b8b4b585f686bc968474917f37d3b82b4a534f456168c67", - "linux-x86_64": "954ac51498519f6ed9540714fb04bc401f70039b296a8160dd1559be380788d7", - }, - strip_prefix = { - "darwin-aarch64": "LLVM-20.1.0-macOS-ARM64", - "linux-aarch64": "LLVM-20.1.0-Linux-ARM64", - "linux-x86_64": "LLVM-20.1.0-Linux-X64", - }, - urls = { - "darwin-aarch64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.0/LLVM-20.1.0-macOS-ARM64.tar.xz"], - "linux-aarch64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.0/LLVM-20.1.0-Linux-ARM64.tar.xz"], - "linux-x86_64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.0/LLVM-20.1.0-Linux-X64.tar.xz"], - }, ) use_repo(llvm, "llvm_toolchain_llvm") diff --git a/bazelmod/llvm.MODULE.bazel b/bazelmod/llvm.MODULE.bazel index d68674a..dab3ba3 100644 --- a/bazelmod/llvm.MODULE.bazel +++ b/bazelmod/llvm.MODULE.bazel @@ -13,12 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -bazel_dep(name = "toolchains_llvm", version = "1.3.0") -git_override( - module_name = "toolchains_llvm", - commit = "e831f94a8b7f3a39391f5822adcab8e4d443c03b", # Add more tools by default (#463) - remote = "https://github.com/bazel-contrib/toolchains_llvm", -) +bazel_dep(name = "toolchains_llvm", version = "1.4.0") llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True) llvm.toolchain(