Skip to content
Closed
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
41 changes: 27 additions & 14 deletions .github/workflows/distro-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
runs-on: ubuntu-latest
container:
image: hyperwin/hcpu-ci:${{ matrix.config.tag }}
# see https://github.com/bazelbuild/bazel/issues/13823
# NOTE: see https://github.com/bazelbuild/bazel/issues/13823
options: --init
name: "Build on ${{matrix.config.name}}"
name: Build on ${{ matrix.config.name }}
strategy:
matrix:
config:
Expand All @@ -37,15 +37,28 @@
name: Ubuntu

steps:
- run: |
set -e
DISTRO=$( cat /etc/*-release | tr [:upper:] [:lower:] | grep -Poi '(debian|ubuntu|fedora|gentoo|alpine)' | uniq )
if [ "$DISTRO" == "gentoo" ]; then
source /etc/profile
fi
git clone https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git && cd HyperCPU
git checkout ${{ github.event.pull_request.head.sha }}
git submodule update --init --recursive

conan profile detect && conan install . --build=cmake --build=missing
bazelisk build //src/... //tests/... --config=linux-opt
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- uses: bazel-contrib/setup-bazel@0.15.0

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'HyperCPU CI/CD Pipeline (build HyperCPU on different platforms)' step
Uses Step
uses 'bazel-contrib/setup-bazel' with ref '0.15.0', not a pinned commit hash
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Run with sourced profile (only for gentoo)
if: contains(matrix.config.name, 'gentoo')
run: |
source /etc/profile \
&& conan profile detect && conan install . --build=missing \
&& bazel test //src/... //tests/... --config=linux-opt

- name: Install conan dependencies
if: ${{ ! contains(matrix.config.name, 'gentoo') }}
run: conan profile detect && conan install . --build=missing

- name: Build and test on Release profile
if: ${{ ! contains(matrix.config.name, 'gentoo') }}
run: bazel test //src/... //tests/... --config=linux-opt
1 change: 0 additions & 1 deletion .github/workflows/docker-autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
submodules: true

- name: Build and push
Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/run-tests-feature-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,36 @@

on:
push:
branches-ignore:
- master
- dev

jobs:
testing:
runs-on: ubuntu-latest
container:
image: hyperwin/hcpu-ci:debian-unstable
# see https://github.com/bazelbuild/bazel/issues/13823
# NOTE: see https://github.com/bazelbuild/bazel/issues/13823
options: --init
if: (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev') || !contains(github.event.head_commit.message, '[ci skip]')
if: ! contains(github.event.head_commit.message, '[ci skip]')

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "true"
submodules: true

- name: Install conan dependecies
run: |
conan profile detect && conan install . --build=missing
- uses: bazel-contrib/setup-bazel@0.15.0

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'HyperCPU CI/CD Pipeline (feature branch)' step
Uses Step
uses 'bazel-contrib/setup-bazel' with ref '0.15.0', not a pinned commit hash
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Install conan dependencies
run: conan profile detect && conan install . --build=missing

- name: Build and test with GCC on Release profile
run: |
bazelisk test //src/... //tests/... --config=linux-dbg --compiler=gcc
bazelisk clean --expunge
run: CC=gcc bazel test //src/... //tests/... --config=linux-dbg && bazel clean --expunge

- name: Build and test with LLVM on Release profile
run: |
bazelisk test //src/... //tests/... --config=linux-dbg --compiler=clang
bazelisk clean --expunge
run: CC=clang bazel test //src/... //tests/... --config=linux-dbg && bazel clean --expunge
31 changes: 14 additions & 17 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,33 @@
runs-on: ubuntu-latest
container:
image: hyperwin/hcpu-ci:debian-unstable
# see https://github.com/bazelbuild/bazel/issues/13823
# NOTE: see https://github.com/bazelbuild/bazel/issues/13823
options: --init
name: Run full test suite

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "true"
submodules: true

- name: Install conan dependecies
run: |
conan profile detect && conan install . --build=missing
- uses: bazel-contrib/setup-bazel@0.15.0

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium test

Unpinned 3rd party Action 'HyperCPU CI/CD Pipeline' step
Uses Step
uses 'bazel-contrib/setup-bazel' with ref '0.15.0', not a pinned commit hash
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Install conan dependencies
run: conan profile detect && conan install . --build=missing

- name: Build and test with GCC on Debug profile
run: |
bazelisk test //src/... //tests/... --config=linux-dbg --compiler=gcc
bazelisk clean --expunge
run: CC=gcc bazel test //src/... //tests/... --config=linux-dbg && bazel clean --expunge

- name: Build and test with GCC on Release profile
run: |
bazelisk test //src/... //tests/... --config=linux-opt --compiler=gcc
bazelisk clean --expunge
run: CC=gcc bazel test //src/... //tests/... --config=linux-opt && bazel clean --expunge

- name: Build and test with LLVM on Debug profile
run: |
bazelisk test //src/... //tests/... --config=linux-dbg --compiler=clang
bazelisk clean --expunge
run: CC=clang bazel test //src/... //tests/... --config=linux-dbg && bazel clean --expunge

- name: Build and test with LLVM on Release profile
run: |
bazelisk test //src/... //tests/... --config=linux-opt --compiler=clang
bazelisk clean --expunge
run: CC=clang bazel test //src/... //tests/... --config=linux-opt && bazel clean --expunge
42 changes: 18 additions & 24 deletions .github/workflows/version-increment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,50 @@
jobs:
versioning-patch-increment:
runs-on: ubuntu-latest
container:
image: hyperwin/hcpu-ci:debian-unstable
options: --user root
if: "contains(github.event.head_commit.message, '[ci patch inc]')"
container: hyperwin/hcpu-ci:debian-unstable
if: contains(github.event.head_commit.message, '[ci patch inc]')
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: "0"
fetch-depth: 0

- name: Setup git user
uses: fregante/setup-git-user@v1

- name: Increment version (patch)
run: |
tools/increment_version.py --increment patch
run: tools/increment_version.py --increment patch

- name: Push changes to master branch
run: |
git config --global --add safe.directory '*'
git add .
git commit -m "[auto]: Increment patch version"
git push origin master
- name: Auto-commit version bump
uses: stefanzweifel/git-auto-commit-action@v5

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'HyperCPU CI/CD Pipeline (version incrementing)' step
Uses Step
uses 'stefanzweifel/git-auto-commit-action' with ref 'v5', not a pinned commit hash
with:
commit_message: "[auto]: Increment patch version"
branch: master

versioning-minor-increment:
runs-on: ubuntu-latest
container: hyperwin/hcpu-ci:debian-unstable
if: "contains(github.event.head_commit.message, '[ci minor inc]')"
if: contains(github.event.head_commit.message, '[ci minor inc]')
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: "0"
fetch-depth: 0

- name: Setup git user
uses: fregante/setup-git-user@v1

- name: Increment version (minor)
run: |
tools/increment_version.py --increment minor

- name: Push changes to master branch
run: |
git config --global --add safe.directory '*'
git add .
git commit -m "[auto]: Increment minor version"
git push origin master
run: tools/increment_version.py --increment minor

- name: Auto-commit version bump
uses: stefanzweifel/git-auto-commit-action@v5

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'HyperCPU CI/CD Pipeline (version incrementing)' step
Uses Step
uses 'stefanzweifel/git-auto-commit-action' with ref 'v5', not a pinned commit hash
with:
commit_message: "[auto]: Increment minor version"
branch: master
10 changes: 5 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ module(
conan = use_extension("//conan:conan_deps_module_extension.bzl", "conan_extension")
use_repo(
conan,
"abseil",
"argparse",
"benchmark",
"boost",
"bzip2",
"eternal",
"fmt",
"gtest",
"libbacktrace",
"libunwind",
"re2",
"spdlog",
"xz_utils",
"zlib",
)

bazel_dep(name = "argparse", version = "3.0.0")
bazel_dep(name = "google_benchmark", version = "1.9.2")
bazel_dep(name = "googletest", version = "1.17.0")
bazel_dep(name = "re2", version = "2024-07-02.bcr.1")

bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "aspect_rules_lint", version = "1.3.5")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
Expand Down
5 changes: 0 additions & 5 deletions conandata.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
requirements:
gtest: "1.14.0"
benchmark: "1.9.1"
abseil: "20240116.1"
libbacktrace: "cci.20210118"
argparse: "3.2"
eternal: "1.0.1"
re2: "20230801"
fmt: "11.0.2"
libunwind: "1.8.1"
boost: "1.87.0"
Expand Down
10 changes: 5 additions & 5 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import Dict, Any, Collection
from functools import cached_property, lru_cache
from typing import Callable, Mapping, Any, Iterable

from conan import ConanFile
from conan.tools.google import bazel_layout
Expand All @@ -9,12 +9,12 @@ class HyperCPU(ConanFile):
name: "HyperCPU"
settings = ["os", "compiler", "build_type", "arch"]

# conan data is fetched dynamically from
# conandata.yml
conan_data: Dict[str, Any]
# dynamically set conanfile attributes
conan_data: Mapping[str, Any]
requires: Callable[[str], None]

@cached_property
def generators(self) -> Collection[str]:
def generators(self) -> Iterable[str]:
return ["BazelToolchain", "BazelDeps"]

@lru_cache
Expand Down
8 changes: 4 additions & 4 deletions src/PCH/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("//tools/bazel:pch.bzl", "precompiled_headers")
load("@rules_cc//cc:defs.bzl", "cc_library")

precompiled_headers(
cc_library(
name = "pch_cstd",
main = "CStd.hpp",
visibility = ["//visibility:public"],
hdrs = ["CStd.hpp"],
visibility = ["//visibility:public"]
)
17 changes: 3 additions & 14 deletions src/Pog/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
load("//tools/bazel:pch.bzl", "precompiled_headers")

cc_library(
name = "pog_core",
name = "pog",
hdrs = glob(
["**/*.hpp"],
exclude = ["Pog.hpp"],
["**/*.hpp"]
),
visibility = ["//visibility:private"],
visibility = ["//visibility:public"],
deps = [
"@fmt",
"@re2",
],
)

precompiled_headers(
name = "pog",
main = "Pog.hpp",
visibility = ["//visibility:public"],
deps = [
":pog_core",
],
)
Loading
Loading