Skip to content

Commit 41bec73

Browse files
jmrcopybara-github
authored andcommitted
workflows: Consolidate workflows
Reduce duplication by using a matrix for both Bazel and CMake. In job names, use Linux-centric x86-64 and AArch64 instead of Windows' x64 and arm64. PiperOrigin-RevId: 901244357
1 parent a8a4319 commit 41bec73

6 files changed

Lines changed: 45 additions & 199 deletions

File tree

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# See https://github.com/actions/runner-images.
1616

17-
name: "Bazel (x64 Windows)"
17+
name: "Bazel"
1818

1919
on:
2020
push:
@@ -30,11 +30,30 @@ concurrency:
3030
permissions: read-all
3131

3232
jobs:
33-
build-and-test-x64-windows-bazel:
34-
runs-on: windows-latest
33+
build-and-test:
34+
# Note that the status check UI will show something like
35+
# `Bazel / Bazel / x86-64 Linux`, but this name is the real name.
36+
name: Bazel / ${{ matrix.name }}
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os: [ubuntu-latest, macos-latest, windows-latest]
42+
include:
43+
- os: ubuntu-latest
44+
name: x86-64 Linux
45+
config: --config=dev
46+
- os: macos-latest
47+
name: AArch64 macOS
48+
config: --config=dev
49+
test_filters: --test_filter=-PywrapFstTest.testRandGen
50+
- os: windows-latest
51+
name: x64 Windows
52+
shell: pwsh
53+
test_filters: --test_tag_filters=-no_windows_msvc
3554
defaults:
3655
run:
37-
shell: pwsh
56+
shell: ${{ matrix.shell || 'bash' }}
3857
env:
3958
USE_BAZEL_VERSION: 9.0.0
4059
steps:
@@ -52,12 +71,12 @@ jobs:
5271
run: bazelisk --version
5372
- name: Build
5473
run: |
55-
bazelisk build -c fastbuild //...
74+
bazelisk build ${{ matrix.config }} -c fastbuild //...
5675
- name: Test
57-
shell: bash # Avoid default PowerShell syntax headaches.
76+
shell: bash
5877
run: >-
59-
bazelisk test -c fastbuild
78+
bazelisk test ${{ matrix.config }} -c fastbuild
6079
--test_size_filters=-enormous
6180
--test_output=errors
62-
--test_tag_filters=-no_windows_msvc
81+
${{ matrix.test_filters }}
6382
//...

.github/workflows/bazel_arm64_macos.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/bazel_x64_linux.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# See https://github.com/actions/runner-images.
1616

17-
name: "CMake (x64 Linux)"
17+
name: "CMake"
1818

1919
on:
2020
push:
@@ -30,10 +30,22 @@ concurrency:
3030
permissions: read-all
3131

3232
jobs:
33-
build-and-test-x64-linux-cmake:
34-
runs-on: ubuntu-latest
33+
build-and-test:
34+
# Note that the status check UI will show something like
35+
# `CMake / CMake / x86-64 Linux`, but this name is the real name.
36+
name: CMake / ${{ matrix.name }}
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os: [ubuntu-latest, macos-latest]
42+
include:
43+
- os: ubuntu-latest
44+
name: x86-64 Linux
45+
- os: macos-latest
46+
name: AArch64 macOS
3547
env:
36-
cache-name: ${{github.job}}
48+
cache-name: ${{github.job}}-${{ matrix.os }}
3749
steps:
3850
- uses: actions/checkout@v6
3951
- name: Set Build Parallelism

.github/workflows/cmake_arm64_macos.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44

55
[![GitHub license](https://img.shields.io/badge/license-Apache2-blue.svg)](https://github.com/google-research/nisaba/blob/main/LICENSE)
66
[![C++ version](https://img.shields.io/badge/C++17-blue.svg?style=flat&logo=c%2B%2B)](https://en.cppreference.com/w/cpp/17)
7-
[![Bazel (x64 Linux)](https://github.com/google-research/openfst/actions/workflows/bazel_x64_linux.yml/badge.svg)](https://github.com/google-research/openfst/actions/workflows/bazel_x64_linux.yml)
8-
[![CMake (x64 Linux)](https://github.com/google-research/openfst/actions/workflows/cmake_x64_linux.yml/badge.svg)](https://github.com/google-research/openfst/actions/workflows/cmake_x64_linux.yml)
9-
[![Bazel (arm64 macOS)](https://github.com/google-research/openfst/actions/workflows/bazel_arm64_macos.yml/badge.svg)](https://github.com/google-research/openfst/actions/workflows/bazel_arm64_macos.yml)
10-
[![CMake (arm64 macOS)](https://github.com/google-research/openfst/actions/workflows/cmake_arm64_macos.yml/badge.svg)](https://github.com/google-research/openfst/actions/workflows/cmake_arm64_macos.yml)
11-
[![Bazel (x64 Windows)](https://github.com/google-research/openfst/actions/workflows/bazel_x64_windows.yml/badge.svg)](https://github.com/google-research/openfst/actions/workflows/bazel_x64_windows.yml)
7+
[![Bazel](https://github.com/google-research/openfst/actions/workflows/bazel.yml/badge.svg)](https://github.com/google-research/openfst/actions/workflows/bazel.yml)
8+
[![CMake](https://github.com/google-research/openfst/actions/workflows/cmake.yml/badge.svg)](https://github.com/google-research/openfst/actions/workflows/cmake.yml)
129

1310
This library is for constructing, combining, optimizing, and searching *weighted
1411
finite-state transducers* (FSTs). Weighted finite-state transducers are automata

0 commit comments

Comments
 (0)