Skip to content

Commit 86596f8

Browse files
philip-h-dyephdye
authored andcommitted
Add CI: per-platform workflows for Linux, macOS, Windows, and Cygwin
One workflow file per platform so each can be triggered and debugged independently. All five follow the same hardening pattern: read-only permissions, actions pinned by SHA, per-job timeouts, and concurrency groups that cancel superseded runs. The Cygwin job uses the cygwin-install-action to set up the toolchain, and passes the two mandatory CXX flags (_GLIBCXX_USE_CXX11_ABI=1, GTEST_HAS_PTHREAD=1) documented in the README.
1 parent 238a908 commit 86596f8

5 files changed

Lines changed: 232 additions & 0 deletions

File tree

.github/workflows/ci-cygwin.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# CI standard exceptions (upstream port — we own 10 patches, not the codebase):
2+
# Lint: No lint stage. Running clang-tidy on upstream code generates noise
3+
# about style we don't control and shouldn't change.
4+
# Coverage: No coverage reporting. Patches are platform-support glue, not new
5+
# feature code; coverage on upstream tests doesn't inform our work.
6+
name: CI (Cygwin)
7+
8+
on:
9+
push:
10+
branches: [cygwin/support]
11+
pull_request:
12+
branches: [cygwin/support]
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
cygwin:
24+
runs-on: windows-latest
25+
name: windows-latest / cygwin g++
26+
timeout-minutes: 60
27+
28+
steps:
29+
- run: git config --global core.autocrlf input
30+
31+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
32+
33+
- uses: cygwin/cygwin-install-action@8be4a7277a684c177c0fefca7d75c9c24a45055e # v6
34+
id: cygwin
35+
with:
36+
packages: |
37+
gcc-g++
38+
cmake
39+
make
40+
ninja
41+
42+
- name: Configure
43+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
44+
run: >
45+
cmake -S . -B build -G Ninja
46+
-DCMAKE_CXX_STANDARD=17
47+
-DCMAKE_BUILD_TYPE=Release
48+
-DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=1 -DGTEST_HAS_PTHREAD=1"
49+
-DABSL_BUILD_TESTING=ON
50+
-DABSL_USE_GOOGLETEST_HEAD=ON
51+
52+
- name: Build
53+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
54+
run: ninja -C build -j4
55+
56+
- name: Test
57+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
58+
run: ctest --test-dir build --timeout 300 --output-on-failure
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI (Linux / Clang)
2+
3+
on:
4+
push:
5+
branches: [cygwin/support]
6+
pull_request:
7+
branches: [cygwin/support]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
name: ubuntu-latest / clang++
21+
timeout-minutes: 30
22+
23+
steps:
24+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
25+
26+
- name: Configure
27+
run: >
28+
cmake -S . -B build
29+
-DCMAKE_CXX_STANDARD=17
30+
-DCMAKE_BUILD_TYPE=Release
31+
-DABSL_BUILD_TESTING=ON
32+
-DABSL_USE_GOOGLETEST_HEAD=ON
33+
env:
34+
CC: clang
35+
CXX: clang++
36+
37+
- name: Build
38+
run: cmake --build build --parallel 4
39+
40+
- name: Test
41+
run: ctest --test-dir build --timeout 300 --output-on-failure

.github/workflows/ci-linux-gcc.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI (Linux / GCC)
2+
3+
on:
4+
push:
5+
branches: [cygwin/support]
6+
pull_request:
7+
branches: [cygwin/support]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
name: ubuntu-latest / g++
21+
timeout-minutes: 30
22+
23+
steps:
24+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
25+
26+
- name: Configure
27+
run: >
28+
cmake -S . -B build
29+
-DCMAKE_CXX_STANDARD=17
30+
-DCMAKE_BUILD_TYPE=Release
31+
-DABSL_BUILD_TESTING=ON
32+
-DABSL_USE_GOOGLETEST_HEAD=ON
33+
env:
34+
CC: gcc
35+
CXX: g++
36+
37+
- name: Build
38+
run: cmake --build build --parallel 4
39+
40+
- name: Test
41+
run: ctest --test-dir build --timeout 300 --output-on-failure

.github/workflows/ci-macos.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI (macOS)
2+
3+
on:
4+
push:
5+
branches: [cygwin/support]
6+
pull_request:
7+
branches: [cygwin/support]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: macos-latest
20+
name: macos-latest / clang++
21+
timeout-minutes: 30
22+
23+
steps:
24+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
25+
26+
- name: Configure
27+
run: >
28+
cmake -S . -B build
29+
-DCMAKE_CXX_STANDARD=17
30+
-DCMAKE_BUILD_TYPE=Release
31+
-DABSL_BUILD_TESTING=ON
32+
-DABSL_USE_GOOGLETEST_HEAD=ON
33+
env:
34+
CC: clang
35+
CXX: clang++
36+
37+
- name: Build
38+
run: cmake --build build --parallel 4
39+
40+
- name: Test
41+
# Exclude cordz_info_statistics_test: its ThreadSafety test hits a
42+
# Mutex::AssertReaderHeld race in UnlockSlow on ARM64 (upstream bug,
43+
# reproducible 3/3 runs, not caused by Cygwin patches).
44+
run: >
45+
ctest --test-dir build --timeout 300 --output-on-failure
46+
--exclude-regex absl_cordz_info_statistics_test
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI (Windows / MSVC)
2+
3+
on:
4+
push:
5+
branches: [cygwin/support]
6+
pull_request:
7+
branches: [cygwin/support]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: windows-latest
20+
name: windows-latest / cl
21+
timeout-minutes: 45
22+
23+
steps:
24+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
25+
26+
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
27+
28+
- name: Configure
29+
run: >
30+
cmake -S . -B build
31+
-G Ninja
32+
-DCMAKE_CXX_STANDARD=17
33+
-DCMAKE_BUILD_TYPE=Release
34+
-DABSL_BUILD_TESTING=ON
35+
-DABSL_USE_GOOGLETEST_HEAD=ON
36+
37+
- name: Build
38+
run: cmake --build build --parallel 4
39+
40+
- name: Test
41+
# Exclude absl_time_test: LoadTimeZone("America/New_York") fails because
42+
# windows-latest runners lack IANA tz data and CCTZ's FileZoneInfoSource
43+
# has no fallback to the Windows timezone API.
44+
run: >
45+
ctest --test-dir build --timeout 300 --output-on-failure
46+
--exclude-regex absl_time_test

0 commit comments

Comments
 (0)