github.com/Oyster-zx/tendermint@v0.34.24-fork/.github/workflows/tests.yml (about)

     1  name: Tests
     2  # Tests runs different tests (test_abci_apps, test_abci_cli, test_apps)
     3  # This workflow runs on every push to master or release branch and  every pull requests
     4  # All jobs will pass without running if no *{.go, .mod, .sum} files have been modified
     5  on:
     6    pull_request:
     7    push:
     8      branches:
     9        - master
    10        - release/**
    11  
    12  jobs:
    13    cleanup-runs:
    14      runs-on: ubuntu-latest
    15      steps:
    16        - uses: rokroskar/workflow-run-cleanup-action@master
    17          env:
    18            GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
    19      if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
    20  
    21    build:
    22      name: Build
    23      runs-on: ubuntu-latest
    24      timeout-minutes: 5
    25      steps:
    26        - uses: actions/setup-go@v3
    27          with:
    28            go-version: "1.18"
    29        - uses: actions/checkout@v3
    30        - uses: technote-space/get-diff-action@v6
    31          with:
    32            PATTERNS: |
    33              **/**.go
    34              go.mod
    35              go.sum
    36        - name: install
    37          run: make install install_abci
    38          if: "env.GIT_DIFF != ''"
    39        - uses: actions/cache@v3
    40          with:
    41            path: ~/go/pkg/mod
    42            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    43            restore-keys: |
    44              ${{ runner.os }}-go-
    45          if: env.GIT_DIFF
    46        # Cache binaries for use by other jobs
    47        - uses: actions/cache@v3
    48          with:
    49            path: ~/go/bin
    50            key: ${{ runner.os }}-${{ github.sha }}-tm-binary
    51          if: env.GIT_DIFF
    52  
    53    test_abci_apps:
    54      runs-on: ubuntu-latest
    55      needs: build
    56      timeout-minutes: 5
    57      steps:
    58        - uses: actions/setup-go@v3
    59          with:
    60            go-version: "^1.18"
    61        - uses: actions/checkout@v3
    62        - uses: technote-space/get-diff-action@v6
    63          with:
    64            PATTERNS: |
    65              **/**.go
    66              go.mod
    67              go.sum
    68        - uses: actions/cache@v3
    69          with:
    70            path: ~/go/pkg/mod
    71            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    72            restore-keys: |
    73              ${{ runner.os }}-go-
    74          if: env.GIT_DIFF
    75        - uses: actions/cache@v3
    76          with:
    77            path: ~/go/bin
    78            key: ${{ runner.os }}-${{ github.sha }}-tm-binary
    79          if: env.GIT_DIFF
    80        - name: test_abci_apps
    81          run: abci/tests/test_app/test.sh
    82          shell: bash
    83          if: env.GIT_DIFF
    84  
    85    test_abci_cli:
    86      runs-on: ubuntu-latest
    87      needs: build
    88      timeout-minutes: 5
    89      steps:
    90        - uses: actions/setup-go@v3
    91          with:
    92            go-version: "^1.18"
    93        - uses: actions/checkout@v3
    94        - uses: technote-space/get-diff-action@v6
    95          with:
    96            PATTERNS: |
    97              **/**.go
    98              go.mod
    99              go.sum
   100        - uses: actions/cache@v3
   101          with:
   102            path: ~/go/pkg/mod
   103            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
   104            restore-keys: |
   105              ${{ runner.os }}-go-
   106          if: env.GIT_DIFF
   107        - uses: actions/cache@v3
   108          with:
   109            path: ~/go/bin
   110            key: ${{ runner.os }}-${{ github.sha }}-tm-binary
   111          if: env.GIT_DIFF
   112        - run: abci/tests/test_cli/test.sh
   113          shell: bash
   114          if: env.GIT_DIFF
   115  
   116    test_apps:
   117      runs-on: ubuntu-latest
   118      needs: build
   119      timeout-minutes: 5
   120      steps:
   121        - uses: actions/setup-go@v3
   122          with:
   123            go-version: "1.18"
   124        - uses: actions/checkout@v3
   125        - uses: technote-space/get-diff-action@v6
   126          with:
   127            PATTERNS: |
   128              **/**.go
   129              go.mod
   130              go.sum
   131        - uses: actions/cache@v3
   132          with:
   133            path: ~/go/pkg/mod
   134            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
   135            restore-keys: |
   136              ${{ runner.os }}-go-
   137          if: env.GIT_DIFF
   138        - uses: actions/cache@v3
   139          with:
   140            path: ~/go/bin
   141            key: ${{ runner.os }}-${{ github.sha }}-tm-binary
   142          if: env.GIT_DIFF
   143        - name: test_apps
   144          run: test/app/test.sh
   145          shell: bash
   146          if: env.GIT_DIFF