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

     1  name: build
     2  on:
     3    push:
     4      branches:
     5        - master
     6    pull_request:
     7      branches:
     8        - master
     9  permissions:
    10    contents: read
    11  
    12  jobs:
    13    tests:
    14      name: UTs ${{ matrix.os }}
    15      runs-on: ${{ matrix.os }}
    16      strategy:
    17        matrix:
    18          os: [windows-latest, ubuntu-latest, macos-latest]
    19  
    20      steps:
    21        - uses: actions/checkout@v4
    22        - name: Set up Go
    23          uses: actions/setup-go@v5
    24          with:
    25            check-latest: true
    26            go-version-file: 'go.mod'
    27        - name: Test
    28          run: go run build/make.go --test --verbose
    29  
    30    lsp-tests:
    31      needs: tests
    32      name: lsp-tests ${{ matrix.os }}
    33      runs-on: ${{ matrix.os }}
    34      strategy:
    35        matrix:
    36          os: [windows-latest, ubuntu-latest]
    37      steps:
    38        - uses: actions/checkout@v4
    39        - name: Set up Go
    40          uses: actions/setup-go@v5
    41          with:
    42            check-latest: true
    43            go-version-file: 'go.mod'
    44        - name: Set up Nodejs
    45          uses: actions/setup-node@v4
    46          with:
    47            node-version: 20
    48            cache: 'npm'
    49            cache-dependency-path: 'build/npm/package-lock.json'
    50  
    51        - name: Build
    52          run: |
    53            go run build/make.go --verbose
    54  
    55        - name: Clone LSP tests
    56          run: |
    57            git clone https://github.com/getgauge/gauge-lsp-tests
    58            cd gauge-lsp-tests
    59            npm install
    60  
    61        - name: Install Gauge (windows)
    62          if: matrix.os == 'windows-latest'
    63          run: |
    64            go run build/make.go --install --verbose
    65            echo "C:\\Program Files\\gauge\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
    66  
    67        - name: Install Gauge (linux)
    68          if: matrix.os != 'windows-latest'
    69          run: |
    70            go run build/make.go --install --prefix=/tmp/gauge --verbose
    71            echo "/tmp/gauge/bin" >> $GITHUB_PATH
    72  
    73        - name: Add js_simple template
    74          run: |
    75            gauge template js_simple https://github.com/getgauge/template-js-simple/releases/latest/download/js_simple.zip
    76  
    77        - name: Prep gauge-js
    78          run: |
    79            git clone https://github.com/getgauge/gauge-js.git
    80            cd gauge-js
    81            npm install
    82          shell: bash
    83  
    84        - name: Install gauge-js
    85          run: |
    86            cd gauge-js
    87            npm run installPlugin
    88  
    89        - name: Run lsp-tests
    90          run: |
    91            cd gauge-lsp-tests
    92            gauge install
    93            gauge run --tags="!knownIssue & (actions_on_project_load | actions_on_file_edit)" --env=js-wd
    94  
    95    functional-tests:
    96      needs: tests
    97      name: FTs ${{ matrix.os }}
    98      runs-on: ${{ matrix.os }}
    99      env:
   100        TAGS: js
   101      strategy:
   102        matrix:
   103          os: [windows-latest, ubuntu-latest]
   104      steps:
   105        - uses: actions/checkout@v4
   106        - name: Set up Go
   107          uses: actions/setup-go@v5
   108          with:
   109            check-latest: true
   110            go-version-file: 'go.mod'
   111        - name: Setup java
   112          uses: actions/setup-java@v4
   113          with:
   114            distribution: 'temurin'
   115            java-version: '11'
   116  
   117        - name: Build
   118          run: go run build/make.go --verbose
   119  
   120        - name: Install Gauge (windows)
   121          if: matrix.os == 'windows-latest'
   122          run: |
   123            go run build/make.go --install --verbose
   124            echo "C:\\Program Files\\gauge\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
   125  
   126        - name: Install Gauge (linux)
   127          if: matrix.os != 'windows-latest'
   128          run: |
   129            go run build/make.go --install --prefix=/tmp/gauge --verbose
   130            echo "/tmp/gauge/bin" >> $GITHUB_PATH
   131  
   132        - name: Add js_simple template
   133          run: |
   134            gauge template js_simple https://github.com/getgauge/template-js-simple/releases/latest/download/js_simple.zip
   135  
   136        - name: Clone gauge-java
   137          run: |
   138            git clone https://github.com/getgauge/gauge-java
   139  
   140        - name: Install Gauge Java plugin from source
   141          run: |
   142            cd gauge-java
   143            go run build/make.go && go run build/make.go --install
   144  
   145        - name: Install Gauge Java maven package locally
   146          run: |
   147            cd gauge-java
   148            mvn -q install -DskipTests -"Dgpg.skip" -D"maven.javadoc.skip=true"
   149  
   150        - name: Prep gauge-js
   151          run: |
   152            git clone https://github.com/getgauge/gauge-js.git
   153            cd gauge-js
   154            npm install
   155          shell: bash
   156  
   157        - name: Install gauge-js
   158          run: |
   159            cd gauge-js
   160            npm run installPlugin
   161  
   162        - name: Prep html-report
   163          run: |
   164            git clone https://github.com/getgauge/html-report
   165            cd html-report
   166            go run build/make.go && go run build/make.go --install
   167          shell: bash
   168  
   169        - name: Prep FTs
   170          run: |
   171            git clone https://github.com/getgauge/gauge-tests
   172            cd gauge-tests
   173            gauge install
   174  
   175        - name: Install gauge and Run FTs (windows)
   176          if: matrix.os == 'windows-latest'
   177          run: |
   178            cd gauge-tests
   179            .\gradlew.bat clean jsFT
   180          shell: pwsh
   181  
   182        - name: Install gauge and Run FTs (linux/osx)
   183          if: matrix.os != 'windows-latest'
   184          run: |
   185            cd gauge-tests
   186            ./gradlew clean jsFT
   187  
   188        - name: Upload logs
   189          uses: actions/upload-artifact@v4
   190          if: failure()
   191          with:
   192            name: ft-logs-${{ matrix.os }}
   193            path: gauge-tests/logs
   194  
   195    build:
   196      name: Build ${{ matrix.os }} artifacts
   197      runs-on: ${{ matrix.os }}
   198      needs: [ functional-tests, lsp-tests ]
   199      strategy:
   200        matrix:
   201          os: [windows-latest, ubuntu-latest, macos-latest]
   202  
   203      steps:
   204        - uses: actions/checkout@v4
   205        - name: Set up Go
   206          uses: actions/setup-go@v5
   207          with:
   208            check-latest: true
   209            go-version-file: 'go.mod'
   210        - name: Build distro for ${{ matrix.os }}
   211          run: go run build/make.go  && go run build/make.go --distro
   212  
   213        - name: Upload artifacts for ${{ matrix.os }}
   214          uses: actions/upload-artifact@v4
   215          with:
   216            name: gauge-artifact-for-${{ matrix.os }}
   217            path: deploy
   218  
   219    benchmark:
   220      name: Benchmark ${{ matrix.project }} | PARALLEL= ${{ matrix.parallel }}
   221      runs-on: ubuntu-latest
   222      needs: [ functional-tests, lsp-tests ]
   223      if: github.event_name == 'pull_request'
   224      strategy:
   225        matrix:
   226          project: [java_simple, java_maven, java_gradle]
   227          parallel: ['parallel', 'serial', 'multithreaded']
   228      env:
   229        BENCHMARK_OUT_DIR: "../out"
   230  
   231      steps:
   232        - uses: actions/checkout@v4
   233          with:
   234            path: gauge
   235        - name: Set up Go
   236          uses: actions/setup-go@v5
   237          with:
   238            check-latest: true
   239            go-version-file: 'gauge/go.mod'
   240            cache-dependency-path: 'gauge/go.sum'
   241        - name: Setup java
   242          uses: actions/setup-java@v4
   243          with:
   244            distribution: 'temurin'
   245            java-version: '11'
   246  
   247        - name: Install Gauge
   248          run: |
   249            cd gauge
   250            go run build/make.go && go run build/make.go --install --prefix=/tmp/gauge --verbose
   251            echo "/tmp/gauge/bin" >> $GITHUB_PATH
   252  
   253        - name: Install gauge-java
   254          run: gauge install java
   255  
   256        - name: Prep benchmark
   257          uses: actions/checkout@v4
   258          with:
   259            repository: getgauge/gauge-benchmarks
   260            path: gauge-benchmarks
   261            ref: master
   262  
   263        - name: Run benchmark ${{matrix.project}} | ${{matrix.parallel}}
   264          id: benchmark_run
   265          env:
   266            PARALLEL: ${{ matrix.parallel != 'serial' }}
   267            enable_multithreading: ${{ matrix.parallel == 'multithreaded' }}
   268          run: |
   269            mkdir -p gauge-benchmarks/out
   270            cd gauge-benchmarks/${{ matrix.project }}
   271            ./run.sh
   272  
   273        - name: Upload benchmark
   274          uses: actions/upload-artifact@v4
   275          with:
   276            name: ${{matrix.project}}_${{matrix.parallel}}
   277            path: gauge-benchmarks/out
   278  
   279    post_result_as_artifact:
   280      name: Aggregate and upload benchmark result as artifact.
   281      runs-on: ubuntu-latest
   282      needs: benchmark
   283      if: github.event_name == 'pull_request'
   284  
   285      steps:
   286        - name: Prep benchmark
   287          uses: actions/checkout@v4
   288          with:
   289            repository: getgauge/gauge-benchmarks
   290            path: gauge-benchmarks
   291            ref: master
   292        - name: Download benchmark results
   293          uses: actions/download-artifact@v4
   294          with:
   295            path: gauge-benchmarks/out/
   296        - name: Generate Comment String
   297          id: gen_comment_str
   298          run: |
   299            cd gauge-benchmarks
   300            ./generate_summary.sh > out/results.md
   301        - name: Publish Benchmark Result
   302          uses: actions/upload-artifact@v4
   303          with:
   304            name: benchmark
   305            path: gauge-benchmarks/out/results.md