Skip to content

Commit 88de0ad

Browse files
committed
ci: Add ubuntu-build.yml from pybind_protobuf
1 parent d55e9d3 commit 88de0ad

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.github/workflows/ubuntu-build.yml

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: ubuntu-build
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
concurrency:
7+
group: ci-${{github.workflow}}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
cmake:
12+
name: CMake ubuntu-22.04
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- name: Show env
16+
run: env
17+
- uses: actions/checkout@v4
18+
- name: Install Build Dependencies
19+
run: >
20+
sudo apt update &&
21+
sudo apt install --no-install-recommends -y
22+
cmake make
23+
- name: Show Python version and platform info
24+
run: |
25+
python --version
26+
python -m platform
27+
- name: Show CMake version
28+
run: cmake --version
29+
- name: CMake Configure
30+
run: cmake -S. -Bbuild -DCMAKE_VERBOSE_MAKEFILE=ON
31+
- name: CMake Build
32+
run: cmake --build build -j$(nproc)
33+
34+
bazel:
35+
strategy:
36+
matrix:
37+
options: [
38+
{version: 14, flags: "-std=c++14"},
39+
{version: 17, flags: "-std=c++17"},
40+
{version: 20, flags: "-std=c++20"},
41+
]
42+
fail-fast: false # Don't cancel all jobs if one fails.
43+
name: Bazel ubuntu-22.04 C++${{ matrix.options.version }}
44+
runs-on: ubuntu-22.04
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Setup Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: 3.11 # Current default version in MODULE.bazel
51+
- name: Show Python version and platform info
52+
run: |
53+
python --version
54+
python -m platform
55+
- uses: bazel-contrib/[email protected]
56+
with:
57+
bazelisk-cache: true
58+
disk-cache: ${{ github.workflow }}
59+
repository-cache: true
60+
- name: Show Bazel version
61+
run: bazel --version
62+
- name: Bazel Build
63+
shell: bash
64+
run: >
65+
bazel build
66+
--cxxopt=${{ matrix.options.flags }} --host_cxxopt=${{ matrix.options.flags }}
67+
--subcommands=pretty_print
68+
--enable_bzlmod
69+
//...
70+
- name: Bazel Test
71+
shell: bash
72+
run: >
73+
bazel test
74+
--cxxopt=${{ matrix.options.flags }} --host_cxxopt=${{ matrix.options.flags }}
75+
--subcommands=pretty_print
76+
--enable_bzlmod
77+
//...

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Github-CI:
2727
[amd64_windows_cmake_link]: ./../../actions/workflows/amd64_windows_cmake.yml
2828

2929
[![build_and_test](./../../actions/workflows/actions.yml/badge.svg)](./../../actions/workflows/actions.yml)
30+
[![ubuntu-build](./../../actions/workflows/ubuntu-build.yml/badge.svg)](./../../actions/workflows/ubuntu-build.yml)
3031

3132
[TOC]
3233

0 commit comments

Comments
 (0)