diff --git a/.github/workflows/bazel_x64_windows.yml b/.github/workflows/bazel.yml similarity index 61% rename from .github/workflows/bazel_x64_windows.yml rename to .github/workflows/bazel.yml index e7941ca4..573ee324 100644 --- a/.github/workflows/bazel_x64_windows.yml +++ b/.github/workflows/bazel.yml @@ -14,7 +14,7 @@ # See https://github.com/actions/runner-images. -name: "Bazel (x64 Windows)" +name: "Bazel" on: push: @@ -30,11 +30,30 @@ concurrency: permissions: read-all jobs: - build-and-test-x64-windows-bazel: - runs-on: windows-latest + build-and-test: + # Note that the status check UI will show something like + # `Bazel / Bazel / x86-64 Linux`, but this name is the real name. + name: Bazel / ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + name: x86-64 Linux + config: --config=dev + - os: macos-latest + name: AArch64 macOS + config: --config=dev + test_filters: --test_filter=-PywrapFstTest.testRandGen + - os: windows-latest + name: x64 Windows + shell: pwsh + test_filters: --test_tag_filters=-no_windows_msvc defaults: run: - shell: pwsh + shell: ${{ matrix.shell || 'bash' }} env: USE_BAZEL_VERSION: 9.0.0 steps: @@ -52,12 +71,12 @@ jobs: run: bazelisk --version - name: Build run: | - bazelisk build -c fastbuild //... + bazelisk build ${{ matrix.config }} -c fastbuild //... - name: Test - shell: bash # Avoid default PowerShell syntax headaches. + shell: bash run: >- - bazelisk test -c fastbuild + bazelisk test ${{ matrix.config }} -c fastbuild --test_size_filters=-enormous --test_output=errors - --test_tag_filters=-no_windows_msvc + ${{ matrix.test_filters }} //... diff --git a/.github/workflows/bazel_arm64_macos.yml b/.github/workflows/bazel_arm64_macos.yml deleted file mode 100644 index 1d0adf3b..00000000 --- a/.github/workflows/bazel_arm64_macos.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2026 The OpenFst Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# See https://github.com/actions/runner-images. - -name: "Bazel (arm64 macOS)" - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{github.workflow }}-${{github.head_ref || github.ref}} - cancel-in-progress: ${{github.ref != 'main'}} - -# This gives read-only access to the token. -permissions: read-all - -jobs: - build-and-test-arm64-macos-bazel: - runs-on: macos-latest - env: - USE_BAZEL_VERSION: 9.0.0 - steps: - - uses: actions/checkout@v6 - - name: Setup Bazel - uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Store build cache per workflow. - disk-cache: ${{github.workflow}} - # Share repository cache between workflows. - repository-cache: true - - name: Check Bazelisk - run: bazelisk --version - - name: Build - run: | - bazelisk build --config=dev -c fastbuild //... - - name: Test - run: >- - bazelisk test --config=dev -c fastbuild - --test_size_filters=-enormous - --test_output=errors - --test_filter="-PywrapFstTest.testRandGen" - //... diff --git a/.github/workflows/bazel_x64_linux.yml b/.github/workflows/bazel_x64_linux.yml deleted file mode 100644 index 16025060..00000000 --- a/.github/workflows/bazel_x64_linux.yml +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2026 The OpenFst Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# See https://github.com/actions/runner-images. - -name: "Bazel (x64 Linux)" - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{github.workflow }}-${{github.head_ref || github.ref}} - cancel-in-progress: ${{github.ref != 'main'}} - -# This gives read-only access to the token. -permissions: read-all - -jobs: - build-and-test-x64-linux-bazel: - runs-on: ubuntu-latest - env: - USE_BAZEL_VERSION: 9.0.0 - steps: - - uses: actions/checkout@v6 - - name: Setup Bazel - uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Store build cache per workflow. - disk-cache: ${{github.workflow}} - # Share repository cache between workflows. - repository-cache: true - - name: Check Bazelisk - run: bazelisk --version - - name: Build - run: | - bazelisk build --config=dev -c fastbuild //... - - name: Test - run: >- - bazelisk test --config=dev -c fastbuild - --test_size_filters=-enormous --test_output=errors - //... diff --git a/.github/workflows/cmake_x64_linux.yml b/.github/workflows/cmake.yml similarity index 79% rename from .github/workflows/cmake_x64_linux.yml rename to .github/workflows/cmake.yml index 7f43ffea..bf7cec60 100644 --- a/.github/workflows/cmake_x64_linux.yml +++ b/.github/workflows/cmake.yml @@ -14,7 +14,7 @@ # See https://github.com/actions/runner-images. -name: "CMake (x64 Linux)" +name: "CMake" on: push: @@ -30,10 +30,22 @@ concurrency: permissions: read-all jobs: - build-and-test-x64-linux-cmake: - runs-on: ubuntu-latest + build-and-test: + # Note that the status check UI will show something like + # `CMake / CMake / x86-64 Linux`, but this name is the real name. + name: CMake / ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + include: + - os: ubuntu-latest + name: x86-64 Linux + - os: macos-latest + name: AArch64 macOS env: - cache-name: ${{github.job}} + cache-name: ${{github.job}}-${{ matrix.os }} steps: - uses: actions/checkout@v6 - name: Set Build Parallelism diff --git a/.github/workflows/cmake_arm64_macos.yml b/.github/workflows/cmake_arm64_macos.yml deleted file mode 100644 index 18fa0a33..00000000 --- a/.github/workflows/cmake_arm64_macos.yml +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2026 The OpenFst Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# See https://github.com/actions/runner-images. - -name: "CMake (arm64 macOS)" - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{github.workflow }}-${{github.head_ref || github.ref}} - cancel-in-progress: ${{github.ref != 'main'}} - -# This gives read-only access to the token. -permissions: read-all - -jobs: - build-and-test-arm64-macos-cmake: - runs-on: macos-latest - env: - cache-name: ${{github.job}} - steps: - - uses: actions/checkout@v6 - - name: Set Build Parallelism - run: | - echo "NPROC=$(getconf _NPROCESSORS_ONLN)" >> $GITHUB_ENV - - name: Setup Python - uses: actions/setup-python@v6 - - name: Check Python - run: python --version - - name: Install dependendcies - run: | - python3 -m pip install --break-system-packages absl-py cython - - name: Setup ccache - uses: hendrikmuhs/ccache-action@1bbbcda0748b3e340dee71a314fa68ffcbd6df79 # v1.2.21 - with: - key: cmake-cache-${{env.cache-name}} - - name: Configure - run: >- - cmake -S . -B build - -DCMAKE_C_COMPILER_LAUNCHER=ccache - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - -DOPENFST_ENABLE_BIN=ON -DOPENFST_BUILD_TESTS=ON -DBUILD_SHARED_LIBS=ON - -DOPENFST_ENABLE_FSTS=ON -DOPENFST_ENABLE_GRM=ON -DOPENFST_ENABLE_PYTHON=ON - -DOPENFST_ENABLE_CATEGORIAL=ON - - name: Build - run: | - cmake --build build -j "$NPROC" - - name: Test - run: | - ctest --test-dir build --output-on-failure -j "$NPROC" diff --git a/README.md b/README.md index 86643d56..90d32e2c 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,8 @@ [![GitHub license](https://img.shields.io/badge/license-Apache2-blue.svg)](https://github.com/google-research/nisaba/blob/main/LICENSE) [![C++ version](https://img.shields.io/badge/C++17-blue.svg?style=flat&logo=c%2B%2B)](https://en.cppreference.com/w/cpp/17) -[![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) -[![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) -[![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) -[![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) -[![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) +[![Bazel](https://github.com/google-research/openfst/actions/workflows/bazel.yml/badge.svg)](https://github.com/google-research/openfst/actions/workflows/bazel.yml) +[![CMake](https://github.com/google-research/openfst/actions/workflows/cmake.yml/badge.svg)](https://github.com/google-research/openfst/actions/workflows/cmake.yml) This library is for constructing, combining, optimizing, and searching *weighted finite-state transducers* (FSTs). Weighted finite-state transducers are automata