|
1 | 1 | name: build |
2 | 2 |
|
3 | | -# Trigger on push, pull request, or via manual dispatch. |
4 | 3 | on: |
5 | 4 | push: |
6 | 5 | pull_request: |
|
10 | 9 | jobs: |
11 | 10 | build: |
12 | 11 | runs-on: ${{ matrix.os }} |
13 | | - name: ${{ matrix.os }} (${{ matrix.preset }}) ${{ matrix.build_type }} |
| 12 | + name: ${{ matrix.name }} |
14 | 13 | timeout-minutes: 30 |
15 | 14 |
|
16 | 15 | strategy: |
17 | 16 | fail-fast: false |
18 | 17 | matrix: |
19 | | - # When adding another, also add to copybara's github_check_runs. |
20 | | - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] |
21 | | - build_type: ['Release'] |
22 | | - preset: ['make', 'windows'] |
23 | | - exclude: |
24 | | - - os: ubuntu-latest |
25 | | - preset: windows |
26 | | - - os: macos-latest |
27 | | - preset: windows |
28 | | - - os: windows-latest |
| 18 | + include: |
| 19 | + - name: ubuntu-latest (make) Release |
| 20 | + os: ubuntu-latest |
29 | 21 | preset: make |
| 22 | + build_type: Release |
| 23 | + cc: gcc-13 |
| 24 | + cxx: g++-13 |
| 25 | + |
| 26 | + - name: ubuntu-latest (gcc-15) Release |
| 27 | + os: ubuntu-latest |
| 28 | + preset: make |
| 29 | + build_type: Release |
| 30 | + cc: gcc-15 |
| 31 | + cxx: g++-15 |
| 32 | + |
| 33 | + - name: macos-latest (make) Release |
| 34 | + os: macos-latest |
| 35 | + preset: make |
| 36 | + build_type: Release |
| 37 | + cc: clang |
| 38 | + cxx: clang++ |
| 39 | + |
| 40 | + - name: windows-latest (windows) Release |
| 41 | + os: windows-latest |
| 42 | + preset: windows |
| 43 | + build_type: Release |
30 | 44 |
|
31 | 45 | concurrency: |
32 | | - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.preset }}-${{ matrix.build_type }} |
| 46 | + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.name }} |
33 | 47 | cancel-in-progress: true |
34 | 48 |
|
35 | 49 | steps: |
36 | | - - uses: actions/checkout@v6 |
| 50 | + - uses: actions/checkout@v6 |
| 51 | + |
| 52 | + - name: Install Linux toolchain |
| 53 | + if: runner.os == 'Linux' |
| 54 | + run: | |
| 55 | + if [[ "${{ matrix.cc }}" == "gcc-15" ]]; then |
| 56 | + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test |
| 57 | + fi |
| 58 | + sudo apt-get update |
| 59 | + sudo apt-get install -y ${{ matrix.cc }} ${{ matrix.cxx }} |
37 | 60 |
|
38 | | - # Set up ccache |
39 | | - - name: ccache |
40 | | - uses: hendrikmuhs/ccache-action@v1.2 |
| 61 | + - name: ccache |
| 62 | + uses: hendrikmuhs/ccache-action@v1.2 |
41 | 63 |
|
42 | | - - name: Configure CMake |
43 | | - run: > |
44 | | - cmake --preset ${{ matrix.preset }} |
45 | | - -S ${{ github.workspace }} -B ${{ github.workspace }}/build |
46 | | - -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} |
47 | | - -D CMAKE_C_COMPILER_LAUNCHER=ccache |
48 | | - -D CMAKE_CXX_COMPILER_LAUNCHER=ccache |
49 | | - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 |
| 64 | + - name: Configure CMake |
| 65 | + run: > |
| 66 | + cmake --preset ${{ matrix.preset }} |
| 67 | + -S ${{ github.workspace }} -B ${{ github.workspace }}/build |
| 68 | + -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} |
| 69 | + -D CMAKE_C_COMPILER=${{ matrix.cc || '' }} |
| 70 | + -D CMAKE_CXX_COMPILER=${{ matrix.cxx || '' }} |
| 71 | + -D CMAKE_C_COMPILER_LAUNCHER=ccache |
| 72 | + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache |
| 73 | + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 |
| 74 | + ${{ matrix.cc == 'gcc-15' && '-DCMAKE_CXX_FLAGS=-Wno-error=missing-declarations -Wno-error=missing-field-initializers' || '' }} |
50 | 75 |
|
51 | | - - name: Build |
52 | | - run: cmake --build ${{ github.workspace }}/build --preset ${{ matrix.preset }} --config ${{ matrix.build_type }} -j 4 |
| 76 | + - name: Build |
| 77 | + run: cmake --build ${{ github.workspace }}/build --preset ${{ matrix.preset }} --config ${{ matrix.build_type }} -j 4 |
53 | 78 |
|
54 | 79 | - name: Archive production artifacts |
55 | | - uses: actions/upload-artifact@v4 |
| 80 | + uses: actions/upload-artifact@v6 |
56 | 81 | with: |
57 | 82 | name: gemma-${{ matrix.os }}-${{ matrix.preset }}-${{ matrix.build_type }}-${{ matrix.cc || 'default' }} |
58 | 83 | path: | |
59 | 84 | ${{ github.workspace }}/build/${{ matrix.build_type }}/gemma.exe |
60 | 85 | ${{ github.workspace }}/build/${{ matrix.build_type }}/libgemma.lib |
61 | 86 | ${{ github.workspace }}/build/gemma |
62 | 87 | ${{ github.workspace }}/build/libgemma.a |
63 | | - - name: Archive production artifacts |
64 | | - uses: actions/upload-artifact@v6 |
65 | | - with: |
66 | | - name: gemma-${{ matrix.os }}-${{ matrix.preset }}-${{ matrix.build_type }} |
67 | | - path: | |
68 | | - ${{ github.workspace }}/build/${{ matrix.build_type }}/gemma.exe |
69 | | - ${{ github.workspace }}/build/${{ matrix.build_type }}/libgemma.lib |
70 | | - ${{ github.workspace }}/build/gemma |
71 | | - ${{ github.workspace }}/build/libgemma.a |
72 | 88 |
|
73 | 89 | bazel: |
74 | 90 | runs-on: ubuntu-latest |
|
0 commit comments