|
| 1 | +# CI workflow for c-reference-signer |
| 2 | +# |
| 3 | +# Run locally with act (https://github.com/nektos/act): |
| 4 | +# act -j build-ubuntu --container-architecture linux/amd64 |
| 5 | +# |
| 6 | +# On Apple Silicon (M-series), always use --container-architecture linux/amd64 |
| 7 | + |
| 8 | +name: CI |
| 9 | + |
| 10 | +on: |
| 11 | + push: |
| 12 | + pull_request: |
| 13 | + |
| 14 | +jobs: |
| 15 | + build-ubuntu: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + compiler: |
| 21 | + - { cc: gcc-11, cxx: g++-11 } |
| 22 | + - { cc: gcc-12, cxx: g++-12 } |
| 23 | + - { cc: gcc-13, cxx: g++-13 } |
| 24 | + - { cc: gcc-14, cxx: g++-14 } |
| 25 | + - { cc: clang-17, cxx: clang++-17 } |
| 26 | + - { cc: clang-18, cxx: clang++-18 } |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Install compiler |
| 31 | + run: | |
| 32 | + sudo apt-get update |
| 33 | + if [[ "${{ matrix.compiler.cc }}" == gcc-* ]]; then |
| 34 | + sudo apt-get install -y ${{ matrix.compiler.cc }} ${{ matrix.compiler.cxx }} |
| 35 | + elif [[ "${{ matrix.compiler.cc }}" == clang-* ]]; then |
| 36 | + sudo apt-get install -y ${{ matrix.compiler.cc }} |
| 37 | + fi |
| 38 | +
|
| 39 | + - name: Build and test |
| 40 | + env: |
| 41 | + CC: ${{ matrix.compiler.cc }} |
| 42 | + run: make |
| 43 | + |
| 44 | + - name: Build reference signer |
| 45 | + env: |
| 46 | + CC: ${{ matrix.compiler.cc }} |
| 47 | + run: make reference_signer |
| 48 | + |
| 49 | + build-macos: |
| 50 | + runs-on: macos-latest |
| 51 | + strategy: |
| 52 | + fail-fast: false |
| 53 | + matrix: |
| 54 | + compiler: |
| 55 | + - { cc: clang, cxx: clang++ } |
| 56 | + - { cc: gcc-13, cxx: g++-13 } |
| 57 | + - { cc: gcc-14, cxx: g++-14 } |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + |
| 61 | + - name: Install GCC (if needed) |
| 62 | + if: startsWith(matrix.compiler.cc, 'gcc') |
| 63 | + run: | |
| 64 | + # Homebrew uses @ instead of - for versioned packages (e.g., gcc@14) |
| 65 | + FORMULA=$(echo "${{ matrix.compiler.cc }}" | sed 's/gcc-/gcc@/') |
| 66 | + brew install "$FORMULA" |
| 67 | +
|
| 68 | + - name: Build and test |
| 69 | + env: |
| 70 | + CC: ${{ matrix.compiler.cc }} |
| 71 | + run: make |
| 72 | + |
| 73 | + - name: Build reference signer |
| 74 | + env: |
| 75 | + CC: ${{ matrix.compiler.cc }} |
| 76 | + run: make reference_signer |
0 commit comments