github.com/getgauge/gauge@v1.6.9/.github/workflows/benchmark.yml (about)

     1  name: benchmark
     2  on:
     3    push:
     4      tags:
     5        - '*'
     6  permissions:
     7    contents: read
     8  
     9  jobs:
    10    benchmark:
    11      name: Benchmark ${{ matrix.project }} | PARALLEL= ${{ matrix.parallel }}
    12      runs-on: ubuntu-latest
    13      if: github.repository_owner == 'getgauge'
    14      strategy:
    15        matrix:
    16          project: [java_simple, java_maven, java_gradle]
    17          parallel: ['parallel', 'serial', 'multithreaded']
    18  
    19      env:
    20        PARALLEL: ${{ matrix.parallel }}
    21        BENCHMARK_OUT_DIR: "../out"
    22  
    23      steps:
    24        - uses: actions/checkout@v4
    25          with:
    26            path: gauge
    27        - name: Set up Go
    28          uses: actions/setup-go@v5
    29          with:
    30            check-latest: true
    31            go-version-file: 'gauge/go.mod'
    32            cache-dependency-path: 'gauge/go.sum'
    33  
    34        - name: Setup java
    35          uses: actions/setup-java@v4
    36          with:
    37            distribution: 'temurin'
    38            java-version: '11'
    39  
    40        - name: Install Gauge
    41          run: |
    42            cd gauge
    43            go run build/make.go && go run build/make.go --install --prefix=/tmp/gauge --verbose
    44            echo "/tmp/gauge/bin" >> $GITHUB_PATH
    45  
    46        - name: Install gauge-java
    47          run: gauge install java
    48  
    49        - name: Prep benchmark
    50          uses: actions/checkout@v4
    51          with:
    52            repository: getgauge/gauge-benchmarks
    53            path: gauge-benchmarks
    54            ref: master
    55  
    56        - name: Run benchmark ${{matrix.project}} | ${{matrix.parallel}}
    57          env:
    58            PARALLEL: ${{ matrix.parallel != 'serial' }}
    59            enable_multithreading: ${{ matrix.parallel == 'multithreaded' }}
    60          run: |
    61            mkdir -p gauge-benchmarks/out
    62            cd gauge-benchmarks/${{matrix.project}}
    63            ./run.sh
    64  
    65        - name: Upload benchmark
    66          uses: actions/upload-artifact@v4
    67          with:
    68            name: ${{matrix.project}}_${{matrix.parallel}}
    69            path: gauge-benchmarks/out
    70  
    71    publish-benchmark:
    72      permissions:
    73        contents: write  # for Git to git push
    74      name: Publish Benchmark
    75      runs-on: ubuntu-latest
    76      needs: [ benchmark ]
    77      if: github.repository_owner == 'getgauge'
    78  
    79      steps:
    80        - name: Prep benchmark
    81          uses: actions/checkout@v4
    82          with:
    83            repository: getgauge/gauge-benchmarks
    84            path: gauge-benchmarks
    85            token: ${{ secrets.GAUGEBOT_GITHUB_TOKEN }}
    86            ref: master
    87  
    88        - name: Download benchmark results
    89          uses: actions/download-artifact@v4
    90          with:
    91            path: gauge-benchmarks/out/
    92  
    93        - name: Publish Results
    94          run: |
    95            cd gauge-benchmarks
    96            find ./out -name '*.csv' -printf "cat %p >> docs/data/gauge/%f\n" | sh
    97            git config user.name "Github Actions"
    98            git config user.email "actions@users.noreply.github.com"
    99            git commit -sam "add benchmark for $GITHUB_SHA"
   100            git push