...

Text file src/github.com/google/flatbuffers/.github/workflows/build.yml

Documentation: github.com/google/flatbuffers/.github/workflows

     1name: CI
     2permissions: read-all
     3
     4on:
     5  # For manual tests.
     6  workflow_dispatch:
     7  push:
     8    tags:
     9      - "*" # new tag version, like `0.8.4` or else
    10    branches:
    11      - master
    12      - flatbuffers-64
    13  pull_request:
    14    branches:
    15      - master
    16
    17jobs:
    18  build-linux:
    19    permissions:
    20      contents: write
    21    outputs:
    22      digests-gcc: ${{ steps.hash-gcc.outputs.hashes }}
    23      digests-clang: ${{ steps.hash-clang.outputs.hashes }}
    24    name: Build Linux
    25    runs-on: ubuntu-latest
    26    strategy:
    27      matrix:
    28        cxx: [g++-10, clang++-12]
    29      fail-fast: false
    30    steps:
    31    - uses: actions/checkout@v3
    32    - name: cmake
    33      run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_STATIC_FLATC=ON .
    34    - name: build
    35      run: make -j
    36    - name: test
    37      run: ./flattests
    38    - name: make flatc executable
    39      run: |
    40        chmod +x flatc
    41        ./flatc --version
    42    # - name: flatc tests
    43    #   run: |
    44    #     yarn global add esbuild
    45    #     python3 tests/flatc/main.py
    46    - name: upload build artifacts
    47      uses: actions/upload-artifact@v1
    48      with:
    49        name: Linux flatc binary ${{ matrix.cxx }}
    50        path: flatc
    51    # Below if only for release.
    52    - name: Zip file
    53      if: startsWith(github.ref, 'refs/tags/')
    54      run: zip Linux.flatc.binary.${{ matrix.cxx }}.zip flatc
    55    - name: Release zip file
    56      uses: softprops/action-gh-release@v1
    57      if: startsWith(github.ref, 'refs/tags/')
    58      with:
    59        files: Linux.flatc.binary.${{ matrix.cxx }}.zip
    60    - name: Generate SLSA subjects - clang
    61      if: matrix.cxx == 'clang++-12' && startsWith(github.ref, 'refs/tags/')
    62      id: hash-clang
    63      run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT
    64    - name: Generate SLSA subjects - gcc
    65      if: matrix.cxx == 'g++-10' && startsWith(github.ref, 'refs/tags/')
    66      id: hash-gcc
    67      run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT
    68      
    69  build-linux-no-file-tests:    
    70    name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS
    71    runs-on: ubuntu-latest
    72    steps:
    73    - uses: actions/checkout@v3
    74    - name: cmake
    75      run: CXX=clang++-12 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" .
    76    - name: build
    77      run: make -j
    78
    79  build-linux-out-of-source:    
    80    name: Build Linux with out-of-source build location
    81    runs-on: ubuntu-latest
    82    steps:
    83    - uses: actions/checkout@v3
    84    - name: make build directory
    85      run: mkdir build
    86    - name: cmake
    87      working-directory: build
    88      run: >
    89        CXX=clang++-12 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON
    90        -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_CPP_STD=17
    91    - name: build
    92      working-directory: build
    93      run: make -j
    94    - name: test
    95      working-directory: build
    96      run: pwd && ./flattests
    97    - name: test C++17
    98      working-directory: build
    99      run: ./flattests_cpp17
   100
   101  build-linux-cpp-std:
   102    name: Build Linux C++
   103    runs-on: ubuntu-latest
   104    strategy:
   105      fail-fast: false
   106      matrix:
   107        std: [11, 14, 17, 20, 23]
   108        cxx: [g++-10, clang++-12]
   109        exclude:
   110          # GCC 10.3.0 doesn't support std 23
   111          - cxx: g++-10
   112            std: 23
   113    steps:
   114    - uses: actions/checkout@v3
   115    - name: cmake
   116      run: >
   117        CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" 
   118        -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON 
   119        -DFLATBUFFERS_CPP_STD=${{ matrix.std }}
   120        -DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}}
   121    - name: build
   122      run: make -j
   123    - name: test
   124      run: ./flattests
   125    - name: test C++17
   126      if: matrix.std >= 17
   127      run: ./flattests_cpp17
   128
   129  build-windows-cpp-std:
   130    name: Build Windows C++
   131    runs-on: windows-2019
   132    strategy:
   133      matrix:
   134        std: [11, 14, 17, 20, 23]
   135      fail-fast: false
   136    steps:
   137    - uses: actions/checkout@v3
   138    - name: Add msbuild to PATH
   139      uses: microsoft/setup-msbuild@v1.1
   140    - name: cmake
   141      run: >
   142        cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release 
   143        -DFLATBUFFERS_STRICT_MODE=ON 
   144        -DFLATBUFFERS_CPP_STD=${{ matrix.std }}
   145        -DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}}
   146    - name: build
   147      run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
   148    - name: test
   149      run: Release\flattests.exe
   150    - name: test C++17
   151      if: matrix.std >= 17
   152      run: Release\flattests_cpp17.exe
   153
   154  build-windows:
   155    permissions:
   156      contents: write
   157    outputs:
   158      digests: ${{ steps.hash.outputs.hashes }}
   159    name: Build Windows 2019 
   160    runs-on: windows-2019
   161    steps:
   162    - uses: actions/checkout@v3
   163    - name: Add msbuild to PATH
   164      uses: microsoft/setup-msbuild@v1.1
   165    - name: cmake
   166      run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_STRICT_MODE=ON .
   167    - name: build
   168      run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
   169    - name: test
   170      run: Release\flattests.exe
   171    # - name: flatc tests
   172    #   run: python3 tests/flatc/main.py --flatc Release\flatc.exe
   173    - name: upload build artifacts
   174      uses: actions/upload-artifact@v1
   175      with:
   176        name: Windows flatc binary
   177        path: Release\flatc.exe
   178    # Below if only for release.
   179    - name: Zip file
   180      if: startsWith(github.ref, 'refs/tags/')
   181      run: move Release/flatc.exe . && Compress-Archive flatc.exe Windows.flatc.binary.zip
   182    - name: Release binary
   183      uses: softprops/action-gh-release@v1
   184      if: startsWith(github.ref, 'refs/tags/')
   185      with:
   186        files: Windows.flatc.binary.zip
   187    - name: Generate SLSA subjects
   188      if: startsWith(github.ref, 'refs/tags/')
   189      id: hash
   190      shell: bash
   191      run: echo "hashes=$(sha256sum Windows.flatc.binary.zip | base64 -w0)" >> $GITHUB_OUTPUT
   192
   193  build-windows-2017:
   194    name: Build Windows 2017
   195    runs-on: windows-2019
   196    steps:
   197    - uses: actions/checkout@v3
   198    - name: Add msbuild to PATH
   199      uses: microsoft/setup-msbuild@v1.1
   200    - name: cmake
   201      run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON .
   202    - name: build tool version 15 (VS 2017)
   203      run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 /p:VisualStudioVersion=15.0
   204    - name: test
   205      run: Release\flattests.exe
   206
   207  build-windows-2015:
   208    name: Build Windows 2015
   209    runs-on: windows-2019
   210    steps:
   211    - uses: actions/checkout@v3
   212    - name: Add msbuild to PATH
   213      uses: microsoft/setup-msbuild@v1.1
   214    - name: cmake
   215      run: cmake -G "Visual Studio 14 2015" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON .
   216    - name: build tool version 14 (VS 2015)
   217      run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 /p:VisualStudioVersion=14.0
   218    - name: test
   219      run: Release\flattests.exe
   220
   221  build-dotnet-windows:
   222    name: Build .NET Windows
   223    runs-on: windows-2019
   224    strategy:
   225      matrix:
   226        configuration: [
   227          '',
   228          '-p:UnsafeByteBuffer=true', 
   229          # Fails two tests currently.
   230          #'-p:EnableSpanT=true,UnsafeByteBuffer=true'
   231          ]
   232    steps:
   233    - uses: actions/checkout@v3
   234    - name: Setup .NET Core SDK
   235      uses: actions/setup-dotnet@v3
   236      with: 
   237        dotnet-version: '3.1.x'
   238    - name: Build
   239      run: |
   240        cd tests\FlatBuffers.Test
   241        dotnet new sln --force --name FlatBuffers.Core.Test
   242        dotnet sln FlatBuffers.Core.Test.sln add FlatBuffers.Core.Test.csproj
   243        dotnet build -c Release ${{matrix.configuration}} -o out FlatBuffers.Core.Test.sln
   244    - name: Run
   245      run: |
   246        cd tests\FlatBuffers.Test
   247        out\FlatBuffers.Core.Test.exe
   248
   249  build-mac-intel:
   250    permissions:
   251      contents: write
   252    outputs:
   253      digests: ${{ steps.hash.outputs.hashes }}
   254    name: Build Mac (for Intel)
   255    runs-on: macos-latest
   256    steps:
   257    - uses: actions/checkout@v3
   258    - name: cmake
   259      run: cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON .
   260    - name: build
   261      run: xcodebuild -toolchain clang -configuration Release -target flattests
   262    - name: check that the binary is x86_64
   263      run: |
   264        info=$(file Release/flatc)
   265        echo $info
   266        echo $info | grep "Mach-O 64-bit executable x86_64"
   267    - name: test
   268      run: Release/flattests
   269    - name: make flatc executable
   270      run: |
   271        chmod +x Release/flatc
   272        Release/flatc --version
   273    # - name: flatc tests
   274    #  run: python3 tests/flatc/main.py --flatc Release/flatc
   275    - name: upload build artifacts
   276      uses: actions/upload-artifact@v1
   277      with:
   278        name: Mac flatc binary
   279        path: Release/flatc
   280    # Below if only for release.
   281    - name: Zip file
   282      if: startsWith(github.ref, 'refs/tags/')
   283      run: mv Release/flatc . && zip MacIntel.flatc.binary.zip flatc
   284    - name: Release binary
   285      uses: softprops/action-gh-release@v1
   286      if: startsWith(github.ref, 'refs/tags/')
   287      with:
   288        files: MacIntel.flatc.binary.zip
   289    - name: Generate SLSA subjects
   290      if: startsWith(github.ref, 'refs/tags/')
   291      id: hash
   292      run: echo "hashes=$(shasum -a 256 MacIntel.flatc.binary.zip | base64)" >> $GITHUB_OUTPUT
   293
   294  build-mac-universal:
   295    permissions:
   296      contents: write
   297    outputs:
   298      digests: ${{ steps.hash.outputs.hashes }}
   299    name: Build Mac (universal build)
   300    runs-on: macos-latest
   301    steps:
   302    - uses: actions/checkout@v3
   303    - name: cmake
   304      run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON .
   305    - name: build
   306      run: xcodebuild -toolchain clang -configuration Release -target flattests
   307    - name: check that the binary is "universal"
   308      run: |
   309        info=$(file Release/flatc)
   310        echo $info
   311        echo $info | grep "Mach-O universal binary with 2 architectures"
   312    - name: test
   313      run: Release/flattests
   314    - name: make flatc executable
   315      run: |
   316        chmod +x Release/flatc
   317        Release/flatc --version
   318    - name: upload build artifacts
   319      uses: actions/upload-artifact@v1
   320      with:
   321        name: Mac flatc binary
   322        path: Release/flatc
   323    # Below if only for release.
   324    - name: Zip file
   325      if: startsWith(github.ref, 'refs/tags/')
   326      run: mv Release/flatc . && zip Mac.flatc.binary.zip flatc
   327    - name: Release binary
   328      uses: softprops/action-gh-release@v1
   329      if: startsWith(github.ref, 'refs/tags/')
   330      with:
   331        files: Mac.flatc.binary.zip
   332    - name: Generate SLSA subjects
   333      if: startsWith(github.ref, 'refs/tags/')
   334      id: hash
   335      run: echo "hashes=$(shasum -a 256 Mac.flatc.binary.zip | base64)" >> $GITHUB_OUTPUT
   336
   337  build-android:
   338   name: Build Android (on Linux)
   339   runs-on: ubuntu-latest
   340   steps:
   341   - uses: actions/checkout@v3
   342   - name: set up Java
   343     uses: actions/setup-java@v3
   344     with:
   345       distribution: 'temurin'
   346       java-version: '11'
   347   - name: set up flatc
   348     run: |
   349       cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON .
   350       make -j
   351       echo "${PWD}" >> $GITHUB_PATH
   352   - name: build
   353     working-directory: android
   354     run: gradle clean build
   355
   356  build-generator:
   357    name: Check Generated Code
   358    runs-on: ubuntu-latest
   359    strategy:
   360      matrix:
   361        cxx: [g++-10, clang++-12]
   362    steps:
   363    - uses: actions/checkout@v3
   364    - name: cmake
   365      run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j
   366    - name: Generate
   367      run: scripts/check_generate_code.py
   368    - name: Generate gRPC
   369      run: scripts/check-grpc-generated-code.py
   370
   371  build-generator-windows:
   372    name: Check Generated Code on Windows
   373    runs-on: windows-2019
   374    steps:
   375    - uses: actions/checkout@v3
   376    - name: Add msbuild to PATH
   377      uses: microsoft/setup-msbuild@v1.1
   378    - name: cmake
   379      run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_STRICT_MODE=ON .
   380    - name: build
   381      run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
   382    - name: Generate
   383      run: python3 scripts/check_generate_code.py --flatc Release\flatc.exe
   384    - name: Generate gRPC
   385      run: python3 scripts/check-grpc-generated-code.py --flatc Release\flatc.exe
   386
   387  build-benchmarks:
   388    name: Build Benchmarks (on Linux)
   389    runs-on: ubuntu-latest
   390    strategy:
   391      matrix:
   392        cxx: [g++-10]
   393    steps:
   394    - uses: actions/checkout@v3
   395    - name: cmake
   396      run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_CXX_FLAGS="-Wno-unused-parameter -fno-aligned-new" -DFLATBUFFERS_BUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j
   397    - name: Run benchmarks
   398      run: ./flatbenchmark --benchmark_repetitions=5 --benchmark_display_aggregates_only=true --benchmark_out_format=console --benchmark_out=benchmarks/results_${{matrix.cxx}}
   399    - name: Upload benchmarks results
   400      uses: actions/upload-artifact@v1
   401      with:
   402        name: Linux flatbenchmark results ${{matrix.cxx}}
   403        path: benchmarks/results_${{matrix.cxx}}
   404
   405  build-java:
   406    name: Build Java
   407    runs-on: ubuntu-latest
   408    steps:
   409    - uses: actions/checkout@v3
   410    - name: test
   411      working-directory: java
   412      run: mvn test
   413
   414  build-kotlin-macos:
   415    name: Build Kotlin MacOS
   416    runs-on: macos-latest
   417    steps:
   418    - name: Checkout
   419      uses: actions/checkout@v3
   420    - uses: gradle/wrapper-validation-action@v1.0.5
   421    - uses: actions/setup-java@v3
   422      with:
   423        distribution: 'temurin'
   424        java-version: '11'
   425    - name: Build
   426      working-directory: kotlin
   427      run: ./gradlew clean iosX64Test macosX64Test
   428
   429  build-kotlin-linux:
   430    name: Build Kotlin Linux
   431    runs-on: ubuntu-latest
   432    steps:
   433    - name: Checkout
   434      uses: actions/checkout@v3
   435    - uses: actions/setup-java@v3
   436      with:
   437        distribution: 'temurin'
   438        java-version: '11'
   439    - uses: gradle/wrapper-validation-action@v1.0.5
   440    - name: Build
   441      working-directory: kotlin
   442      # we are using docker's version of gradle
   443      # so no need for wrapper validation or user
   444      # gradlew
   445      run: gradle jvmMainClasses jvmTest jsTest jsBrowserTest
   446
   447  build-rust-linux:
   448    name: Build Rust Linux
   449    runs-on: ubuntu-latest
   450    steps:
   451    - uses: actions/checkout@v3
   452    - name: test
   453      working-directory: tests
   454      run: bash RustTest.sh
   455  
   456  build-rust-windows:
   457    name: Build Rust Windows
   458    runs-on: windows-2019
   459    steps:
   460    - uses: actions/checkout@v3
   461    - name: test
   462      working-directory: tests
   463      run: ./RustTest.bat
   464
   465  build-python:
   466    name: Build Python
   467    runs-on: ubuntu-latest
   468    steps:
   469    - uses: actions/checkout@v3
   470    - name: flatc
   471      # FIXME: make test script not rely on flatc
   472      run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j
   473    - name: test
   474      working-directory: tests
   475      run: bash PythonTest.sh
   476
   477  build-go:
   478    name: Build Go
   479    runs-on: ubuntu-latest
   480    steps:
   481    - uses: actions/checkout@v3
   482    - name: flatc
   483      # FIXME: make test script not rely on flatc
   484      run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j
   485    - name: test
   486      working-directory: tests
   487      run: bash GoTest.sh
   488
   489  build-php:
   490   name: Build PHP
   491   runs-on: ubuntu-latest
   492   steps:
   493   - uses: actions/checkout@v3
   494   - name: flatc
   495     # FIXME: make test script not rely on flatc
   496     run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j
   497   - name: test
   498     working-directory: tests
   499     run: |
   500       php phpTest.php
   501       sh phpUnionVectorTest.sh
   502
   503  build-swift:
   504    name: Build Swift
   505    runs-on: ubuntu-latest
   506    steps:
   507    - uses: actions/checkout@v3
   508    - name: test
   509      working-directory: tests/swift/tests
   510      run: |
   511        swift build --build-tests
   512        swift test
   513
   514  build-swift-wasm:
   515    name: Build Swift Wasm
   516    runs-on: ubuntu-latest
   517    container:
   518      image: ghcr.io/swiftwasm/carton:0.15.3
   519    steps:
   520      - uses: actions/checkout@v3
   521      - name: Setup Wasmer
   522        uses: wasmerio/setup-wasmer@v2
   523      - name: Test
   524        working-directory: tests/swift/Wasm.tests
   525        run: carton test
   526
   527  build-ts:
   528    name: Build TS
   529    runs-on: ubuntu-latest
   530    steps:
   531    - uses: actions/checkout@v3
   532    - name: flatc
   533      # FIXME: make test script not rely on flatc
   534      run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j
   535    - name: deps
   536      run: yarn
   537    - name: compile
   538      run: yarn compile
   539    - name: test
   540      working-directory: tests/ts
   541      run: |
   542        yarn global add esbuild
   543        python3 TypeScriptTest.py
   544
   545  build-dart:
   546    name: Build Dart
   547    runs-on: ubuntu-latest
   548    steps:
   549      - uses: actions/checkout@v3
   550      - uses: dart-lang/setup-dart@v1
   551        with:
   552          sdk: stable
   553      - name: flatc
   554        # FIXME: make test script not rely on flatc
   555        run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j
   556      - name: test
   557        working-directory: tests
   558        run: bash DartTest.sh
   559
   560  build-nim:
   561    name: Build Nim
   562    runs-on: ubuntu-latest
   563    steps:
   564    - uses: actions/checkout@v3
   565    - name: flatc
   566      # FIXME: make test script not rely on flatc
   567      run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j
   568    - uses: jiro4989/setup-nim-action@v1
   569    - name: install library
   570      working-directory: nim
   571      run: nimble -y develop
   572    - name: test
   573      working-directory: tests/nim
   574      run: python3 testnim.py
   575
   576  release-digests:
   577    if: startsWith(github.ref, 'refs/tags/')
   578    needs: [build-linux, build-windows, build-mac-intel, build-mac-universal]
   579    outputs:
   580      digests: ${{ steps.hash.outputs.digests }}
   581    runs-on: ubuntu-latest
   582    steps:
   583      - name: Merge results
   584        id: hash
   585        env:
   586          LINUXGCC_DIGESTS: "${{ needs.build-linux.outputs.digests-gcc }}"
   587          LINUXCLANG_DIGESTS: "${{ needs.build-linux.outputs.digests-clang }}"
   588          MAC_DIGESTS: "${{ needs.build-mac-universal.outputs.digests }}"
   589          MACINTEL_DIGESTS: "${{ needs.build-mac-intel.outputs.digests }}"
   590          WINDOWS_DIGESTS: "${{ needs.build-windows.outputs.digests }}"
   591        run: |
   592          set -euo pipefail
   593          echo "$LINUXGCC_DIGESTS" | base64 -d > checksums.txt
   594          echo "$LINUXCLANG_DIGESTS" | base64 -d >> checksums.txt
   595          echo "$MAC_DIGESTS" | base64 -d >> checksums.txt
   596          echo "$MACINTEL_DIGESTS" | base64 -d >> checksums.txt
   597          echo "$WINDOWS_DIGESTS" | base64 -d >> checksums.txt
   598          echo "digests=$(cat checksums.txt | base64 -w0)" >> $GITHUB_OUTPUT
   599
   600  provenance:
   601    if: startsWith(github.ref, 'refs/tags/')
   602    needs: [release-digests]
   603    permissions:
   604      actions: read   # To read the workflow path.
   605      id-token: write # To sign the provenance.
   606      contents: write # To add assets to a release.
   607    uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.2.1
   608    with:
   609      base64-subjects: "${{ needs.release-digests.outputs.digests }}"
   610      upload-assets: true # Optional: Upload to a new release
   611      compile-generator: true # Workaround for https://github.com/slsa-framework/slsa-github-generator/issues/1163

View as plain text