Skip to content

Commit 938fdcc

Browse files
committed
ci: add few workflows
1 parent 2551c56 commit 938fdcc

File tree

4 files changed

+295
-0
lines changed

4 files changed

+295
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# ref: https://github.com/actions/runner-images
2+
name: amd64 Linux Bazel
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
# Building using the github runner environement directly.
7+
jobs:
8+
native:
9+
strategy:
10+
matrix:
11+
bazel: [
12+
{compilation_mode: opt},
13+
{compilation_mode: dbg},
14+
]
15+
cpp: [
16+
{version: 14, flags: "-std=c++14"},
17+
{version: 17, flags: "-std=c++17"},
18+
{version: 20, flags: "-std=c++20"},
19+
]
20+
python: [
21+
{version: '3.11'},
22+
]
23+
exclude:
24+
# only test `-c dbg` build with C++17
25+
- cpp: {version: 14}
26+
bazel: {compilation_mode: dbg}
27+
- cpp: {version: 20}
28+
bazel: {compilation_mode: dbg}
29+
fail-fast: false
30+
name: Linux•Bazel(${{ matrix.bazel.compilation_mode }})•C++${{ matrix.cpp.version }}•Python${{ matrix.python.version }}
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Check Java
35+
run: java -version
36+
- name: Setup Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: ${{ matrix.python.version }}
40+
- name: Check Python
41+
run: |
42+
python --version
43+
python -m platform
44+
- uses: bazel-contrib/[email protected]
45+
with:
46+
bazelisk-cache: true
47+
disk-cache: ${{ github.workflow }}
48+
repository-cache: true
49+
- name: Check Bazel
50+
run: bazel version
51+
- name: Build
52+
run: >
53+
cd examples/basic &&
54+
bazel build
55+
-c ${{ matrix.bazel.compilation_mode }}
56+
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
57+
--subcommands=pretty_print
58+
--enable_bzlmod
59+
//...
60+
- name: Test
61+
run: >
62+
cd examples/basic &&
63+
bazel test
64+
-c ${{ matrix.bazel.compilation_mode }}
65+
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
66+
--subcommands=pretty_print
67+
--enable_bzlmod
68+
//...
69+
70+
amd64_linux_bazel:
71+
runs-on: ubuntu-latest
72+
needs: native
73+
steps:
74+
- uses: actions/checkout@v4
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# ref: https://github.com/actions/runner-images
2+
name: amd64 MacOS Bazel
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
# Building using the github runner environement directly.
7+
jobs:
8+
native:
9+
strategy:
10+
matrix:
11+
bazel: [
12+
{compilation_mode: opt},
13+
{compilation_mode: dbg},
14+
]
15+
cpp: [
16+
#{version: 14, flags: "-std=c++14"},
17+
{version: 17, flags: "-std=c++17"},
18+
#{version: 20, flags: "-std=c++20"},
19+
]
20+
python: [
21+
{version: '3.11'},
22+
]
23+
exclude:
24+
# only test `-c dbg` build with C++17
25+
- cpp: {version: 14}
26+
bazel: {compilation_mode: dbg}
27+
- cpp: {version: 20}
28+
bazel: {compilation_mode: dbg}
29+
fail-fast: false
30+
name: MacOS•Bazel(${{ matrix.bazel.compilation_mode }})•C++${{ matrix.cpp.version }}•Python${{ matrix.python.version }}
31+
runs-on: macos-13 # last macos intel based runner
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Set Java to OpenJDK 17 (Temurin)
35+
uses: actions/setup-java@v3
36+
with:
37+
distribution: 'temurin'
38+
java-version: '17'
39+
- name: Setup Python
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: ${{ matrix.python.version }}
43+
- name: Check Python
44+
run: |
45+
python --version
46+
python -m platform
47+
- name: Check Bazel
48+
run: bazel version
49+
- name: Build
50+
run: >
51+
cd examples/basic &&
52+
bazel build
53+
-c ${{ matrix.bazel.compilation_mode }}
54+
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
55+
--subcommands=pretty_print
56+
--enable_bzlmod
57+
//...
58+
- name: Test
59+
run: >
60+
cd examples/basic &&
61+
bazel test
62+
-c ${{ matrix.bazel.compilation_mode }}
63+
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
64+
--subcommands=pretty_print
65+
--enable_bzlmod
66+
//...
67+
68+
amd64_macos_bazel:
69+
runs-on: ubuntu-latest
70+
needs: native
71+
steps:
72+
- uses: actions/checkout@v4
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# ref: https://github.com/actions/runner-images
2+
name: amd64 Windows Bazel
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
# Building using the github runner environement directly.
7+
jobs:
8+
native:
9+
strategy:
10+
matrix:
11+
runner: [
12+
windows-2022,
13+
#windows-2019,
14+
]
15+
bazel: [
16+
{compilation_mode: opt},
17+
{compilation_mode: dbg},
18+
]
19+
cpp: [
20+
{version: 14, flags: "/std:c++14"},
21+
{version: 17, flags: "/std:c++17"},
22+
#{version: 20, flags: "/std:c++20"},
23+
]
24+
python: [
25+
{version: '3.11'},
26+
]
27+
exclude:
28+
- runner: windows-2019
29+
cpp: {version: 20}
30+
# only test -c dbg with VS 2022 version 17 to save compute time
31+
- runner: windows-2019
32+
bazel: {compilation_mode: dbg}
33+
- cpp: {version: 14}
34+
bazel: {compilation_mode: dbg}
35+
- cpp: {version: 20}
36+
bazel: {compilation_mode: dbg}
37+
fail-fast: false # Don't cancel all jobs if one fails.
38+
name: ${{ matrix.runner }}•Bazel(${{ matrix.bazel.compilation_mode }})•C++${{ matrix.cpp.version }}•Python${{ matrix.python.version }}
39+
runs-on: ${{ matrix.runner }}
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Setup Python
43+
uses: actions/setup-python@v5
44+
with:
45+
python-version: ${{ matrix.python.version }}
46+
- name: Check Python
47+
run: |
48+
python --version
49+
python -m platform
50+
- name: Install Bazel
51+
run: choco install bazel
52+
- name: Check Bazel
53+
run: bazel version
54+
- name: Build
55+
run: >
56+
cd examples/basic &&
57+
bazel build
58+
-c ${{ matrix.bazel.compilation_mode }}
59+
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
60+
--subcommands=pretty_print
61+
--enable_bzlmod
62+
//...
63+
- name: Test
64+
run: >
65+
cd examples/basic &&
66+
bazel test
67+
-c ${{ matrix.bazel.compilation_mode }}
68+
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
69+
--subcommands=pretty_print
70+
--enable_bzlmod
71+
//...
72+
73+
amd64_windows_bazel:
74+
runs-on: ubuntu-latest
75+
needs: native
76+
steps:
77+
- uses: actions/checkout@v4
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# ref: https://github.com/actions/runner-images
2+
name: arm64 MacOS Bazel
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
# Building using the github runner environement directly.
7+
jobs:
8+
native:
9+
strategy:
10+
matrix:
11+
bazel: [
12+
{compilation_mode: opt},
13+
{compilation_mode: dbg},
14+
]
15+
cpp: [
16+
#{version: 14, flags: "-std=c++14"},
17+
{version: 17, flags: "-std=c++17"},
18+
#{version: 20, flags: "-std=c++20"},
19+
]
20+
python: [
21+
{version: '3.11'},
22+
]
23+
exclude:
24+
# only test `-c dbg` build with C++17
25+
- cpp: {version: 14}
26+
bazel: {compilation_mode: dbg}
27+
- cpp: {version: 20}
28+
bazel: {compilation_mode: dbg}
29+
fail-fast: false
30+
name: MacOS•Bazel(${{ matrix.bazel.compilation_mode }})•C++${{ matrix.cpp.version }}•Python${{ matrix.python.version }}
31+
runs-on: macos-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Set Java to OpenJDK 17 (Temurin)
35+
uses: actions/setup-java@v3
36+
with:
37+
distribution: 'temurin'
38+
java-version: '17'
39+
- name: Setup Python
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: ${{ matrix.python.version }}
43+
- name: Check Python
44+
run: |
45+
python --version
46+
python -m platform
47+
- name: Check Bazel
48+
run: bazel version
49+
- name: Build
50+
run: >
51+
cd examples/basic &&
52+
bazel build
53+
-c ${{ matrix.bazel.compilation_mode }}
54+
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
55+
--subcommands=pretty_print
56+
--enable_bzlmod
57+
//...
58+
- name: Test
59+
run: >
60+
cd examples/basic &&
61+
bazel test
62+
-c ${{ matrix.bazel.compilation_mode }}
63+
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
64+
--subcommands=pretty_print
65+
--enable_bzlmod
66+
//...
67+
68+
arm64_macos_bazel:
69+
runs-on: ubuntu-latest
70+
needs: native
71+
steps:
72+
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)