Repository navigation
internal only + removing unused include #8442
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| push: | |
| pull_request: | |
| types: [opened, reopened, labeled, unlabeled, synchronize] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| name: ${{ matrix.name }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: ubuntu-latest (make) Release | |
| os: ubuntu-latest | |
| preset: make | |
| build_type: Release | |
| cc: gcc-13 | |
| cxx: g++-13 | |
| - name: ubuntu-latest (gcc-15) Release | |
| os: ubuntu-latest | |
| preset: make | |
| build_type: Release | |
| cc: gcc-15 | |
| cxx: g++-15 | |
| - name: macos-latest (make) Release | |
| os: macos-latest | |
| preset: make | |
| build_type: Release | |
| cc: clang | |
| cxx: clang++ | |
| - name: windows-latest (windows) Release | |
| os: windows-latest | |
| preset: windows | |
| build_type: Release | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.name }} | |
| cancel-in-progress: true | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Linux toolchain | |
| if: runner.os == 'Linux' | |
| run: | | |
| if [[ "${{ matrix.cc }}" == "gcc-15" ]]; then | |
| sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
| fi | |
| sudo apt-get update | |
| sudo apt-get install -y ${{ matrix.cc }} ${{ matrix.cxx }} | |
| - name: Setup CMake | |
| if: runner.os == 'Windows' | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: '4.2' | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| - name: Configure CMake | |
| run: > | |
| cmake --preset ${{ matrix.preset }} | |
| -S ${{ github.workspace }} -B ${{ github.workspace }}/build | |
| -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| -D CMAKE_C_COMPILER=${{ matrix.cc || '' }} | |
| -D CMAKE_CXX_COMPILER=${{ matrix.cxx || '' }} | |
| -D CMAKE_C_COMPILER_LAUNCHER=ccache | |
| -D CMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| -DCMAKE_POLICY_VERSION_MINIMUM="3.5" | |
| ${{ matrix.cc == 'gcc-15' && '-DCMAKE_CXX_FLAGS=-Wno-error=missing-declarations -Wno-error=missing-field-initializers' || '' }} | |
| - name: Build | |
| run: cmake --build ${{ github.workspace }}/build --preset ${{ matrix.preset }} --config ${{ matrix.build_type }} -j 4 | |
| - name: Archive production artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: gemma-${{ matrix.os }}-${{ matrix.preset }}-${{ matrix.build_type }}-${{ matrix.cc || 'default' }} | |
| path: | | |
| ${{ github.workspace }}/build/${{ matrix.build_type }}/gemma.exe | |
| ${{ github.workspace }}/build/${{ matrix.build_type }}/libgemma.lib | |
| ${{ github.workspace }}/build/gemma | |
| ${{ github.workspace }}/build/libgemma.a | |
| bazel: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1 | |
| with: | |
| egress-policy: audit # cannot be block - runner does git checkout | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| # Namespace disk-cache by runner image and GCC version so compiler | |
| # upgrades recompile all sources rather than reusing older .o blobs. | |
| - id: cc | |
| run: echo "ver=${ImageOS}-${ImageVersion}-$(gcc -dumpfullversion)" >> "$GITHUB_OUTPUT" | |
| - uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| repository-cache: true | |
| disk-cache: ${{ steps.cc.outputs.ver }}-${{ hashFiles('.bazelrc', 'bazel/**') }} | |
| - run: bazel build --cxxopt=-std=c++20 //:gemma --jobs=10 --show_progress_rate_limit=1 |