Skip to content

Commit a99eb7f

Browse files
committed
update actions
1 parent 5e66ab1 commit a99eb7f

6 files changed

Lines changed: 73 additions & 72 deletions

File tree

.github/workflows/distro-ci.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414
container:
1515
image: hyperwin/hcpu-ci:${{ matrix.config.tag }}
16-
# see https://github.com/bazelbuild/bazel/issues/13823
16+
# NOTE: see https://github.com/bazelbuild/bazel/issues/13823
1717
options: --init
18-
name: "Build on ${{matrix.config.name}}"
18+
name: Build on ${{ matrix.config.name }}
1919
strategy:
2020
matrix:
2121
config:
@@ -37,15 +37,22 @@ jobs:
3737
name: Ubuntu
3838

3939
steps:
40-
- run: |
41-
set -e
42-
DISTRO=$( cat /etc/*-release | tr [:upper:] [:lower:] | grep -Poi '(debian|ubuntu|fedora|gentoo|alpine)' | uniq )
43-
if [ "$DISTRO" == "gentoo" ]; then
44-
source /etc/profile
45-
fi
46-
git clone https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git && cd HyperCPU
47-
git checkout ${{ github.event.pull_request.head.sha }}
48-
git submodule update --init --recursive
40+
- name: Checkout code
41+
uses: actions/checkout@v4
42+
with:
43+
submodules: true
44+
45+
- name: Run with sourced profile (only for gentoo)
46+
if: contains(${{ matrix.config.name }}, 'gentoo')
47+
run: |
48+
source /etc/profile \
49+
&& conan profile detect && conan install . --build=missing \
50+
&& bazel test //src/... //tests/... --config=linux-opt
4951
50-
conan profile detect && conan install . --build=cmake --build=missing
51-
bazelisk build //src/... //tests/... --config=linux-opt
52+
- name: Install conan dependencies
53+
if: ! contains(${{ matrix.config.name }}, 'gentoo')
54+
run: conan profile detect && conan install . --build=missing
55+
56+
- name: Build and test on Release profile
57+
if: ! contains(${{ matrix.config.name }}, 'gentoo')
58+
run: bazel test //src/... //tests/... --config=linux-opt

.github/workflows/docker-autobuild.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
- name: Checkout repository
4646
uses: actions/checkout@v4
4747
with:
48-
fetch-depth: 2
4948
submodules: true
5049

5150
- name: Build and push

.github/workflows/run-tests-feature-branch.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,36 @@ name: HyperCPU CI/CD Pipeline (feature branch)
22

33
on:
44
push:
5+
branches-ignore:
6+
- master
7+
- dev
58

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

1518
steps:
1619
- name: Checkout code
1720
uses: actions/checkout@v4
1821
with:
19-
submodules: "true"
22+
submodules: true
2023

21-
- name: Install conan dependecies
22-
run: |
23-
conan profile detect && conan install . --build=missing
24+
- uses: bazel-contrib/setup-bazel@0.15.0
25+
with:
26+
bazelisk-cache: true
27+
disk-cache: ${{ github.workflow }}
28+
repository-cache: true
29+
30+
- name: Install conan dependencies
31+
run: conan profile detect && conan install . --build=missing
2432

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

3036
- name: Build and test with LLVM on Release profile
31-
run: |
32-
bazelisk test //src/... //tests/... --config=linux-dbg --compiler=clang
33-
bazelisk clean --expunge
37+
run: CC=clang bazel test //src/... //tests/... --config=linux-dbg && bazel clean --expunge

.github/workflows/testing.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,33 @@ jobs:
1010
runs-on: ubuntu-latest
1111
container:
1212
image: hyperwin/hcpu-ci:debian-unstable
13-
# see https://github.com/bazelbuild/bazel/issues/13823
13+
# NOTE: see https://github.com/bazelbuild/bazel/issues/13823
1414
options: --init
1515
name: Run full test suite
1616

1717
steps:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
2020
with:
21-
submodules: "true"
21+
submodules: true
2222

23-
- name: Install conan dependecies
24-
run: |
25-
conan profile detect && conan install . --build=missing
23+
- uses: bazel-contrib/setup-bazel@0.15.0
24+
with:
25+
bazelisk-cache: true
26+
disk-cache: ${{ github.workflow }}
27+
repository-cache: true
28+
29+
- name: Install conan dependencies
30+
run: conan profile detect && conan install . --build=missing
2631

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

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

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

4241
- name: Build and test with LLVM on Release profile
43-
run: |
44-
bazelisk test //src/... //tests/... --config=linux-opt --compiler=clang
45-
bazelisk clean --expunge
42+
run: CC=clang bazel test //src/... //tests/... --config=linux-opt && bazel clean --expunge

.github/workflows/version-increment.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,56 +8,50 @@ on:
88
jobs:
99
versioning-patch-increment:
1010
runs-on: ubuntu-latest
11-
container:
12-
image: hyperwin/hcpu-ci:debian-unstable
13-
options: --user root
14-
if: "contains(github.event.head_commit.message, '[ci patch inc]')"
11+
container: hyperwin/hcpu-ci:debian-unstable
12+
if: contains(github.event.head_commit.message, '[ci patch inc]')
1513
permissions:
1614
contents: write
1715

1816
steps:
1917
- name: Checkout code
2018
uses: actions/checkout@v4
2119
with:
22-
fetch-depth: "0"
20+
fetch-depth: 0
2321

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

2725
- name: Increment version (patch)
28-
run: |
29-
tools/increment_version.py --increment patch
26+
run: tools/increment_version.py --increment patch
3027

31-
- name: Push changes to master branch
32-
run: |
33-
git config --global --add safe.directory '*'
34-
git add .
35-
git commit -m "[auto]: Increment patch version"
36-
git push origin master
28+
- name: Auto-commit version bump
29+
uses: stefanzweifel/git-auto-commit-action@v5
30+
with:
31+
commit_message: "[auto]: Increment patch version"
32+
branch: master
3733

3834
versioning-minor-increment:
3935
runs-on: ubuntu-latest
4036
container: hyperwin/hcpu-ci:debian-unstable
41-
if: "contains(github.event.head_commit.message, '[ci minor inc]')"
37+
if: contains(github.event.head_commit.message, '[ci minor inc]')
4238
permissions:
4339
contents: write
4440

4541
steps:
4642
- name: Checkout code
4743
uses: actions/checkout@v4
4844
with:
49-
fetch-depth: "0"
45+
fetch-depth: 0
5046

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

5450
- name: Increment version (minor)
55-
run: |
56-
tools/increment_version.py --increment minor
57-
58-
- name: Push changes to master branch
59-
run: |
60-
git config --global --add safe.directory '*'
61-
git add .
62-
git commit -m "[auto]: Increment minor version"
63-
git push origin master
51+
run: tools/increment_version.py --increment minor
52+
53+
- name: Auto-commit version bump
54+
uses: stefanzweifel/git-auto-commit-action@v5
55+
with:
56+
commit_message: "[auto]: Increment minor version"
57+
branch: master

conanfile.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from typing import Dict, Any, Collection
21
from functools import cached_property, lru_cache
2+
from typing import Callable, Mapping, Any, Iterable
33

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

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

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

2020
@lru_cache

0 commit comments

Comments
 (0)