pkg.re/essentialkaos/ek.10@v12.41.0+incompatible/.github/workflows/ci.yml (about)

     1  name: CI
     2  
     3  on:
     4    push:
     5      branches: [master, develop]
     6    pull_request:
     7      branches: [master]
     8    schedule:
     9      - cron: '0 14 */15 * *'
    10  
    11  jobs:
    12    Go:
    13      name: Go
    14      runs-on: ${{ matrix.os }}
    15  
    16      env:
    17        SRC_DIR: src/github.com/${{ github.repository }}
    18        EK_TEST_PORT: 8080
    19        GO111MODULE: off
    20  
    21      strategy:
    22        matrix:
    23          os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
    24          go: [ '1.16.x', '1.17.x' ]
    25  
    26      steps:
    27        - name: Set up Go
    28          uses: actions/setup-go@v2
    29          with:
    30            go-version: ${{ matrix.go }}
    31          id: go
    32  
    33        - name: Setup PATH
    34          run: |
    35            echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
    36            echo "GOBIN=${{ github.workspace }}/bin" >> "$GITHUB_ENV"
    37            echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
    38  
    39        - name: Checkout
    40          uses: actions/checkout@v2
    41          with:
    42            path: ${{env.SRC_DIR}}
    43  
    44        - name: Download dependencies
    45          working-directory: ${{env.SRC_DIR}}
    46          if: ${{ runner.os != 'Windows' }}
    47          run: make deps deps-test
    48  
    49        - name: Run tests on Linux/Mac
    50          working-directory: ${{env.SRC_DIR}}
    51          if: ${{ runner.os != 'Windows' }}
    52          run: .scripts/nix.sh 12
    53  
    54        - name: Run tests on Windows
    55          working-directory: ${{env.SRC_DIR}}
    56          if: ${{ runner.os == 'Windows' }}
    57          run: .scripts/windows.sh 12
    58  
    59        - name: Install goveralls
    60          if: ${{ runner.os != 'Windows' }}
    61          env:
    62            GO111MODULE: off
    63          run: go get -v github.com/mattn/goveralls
    64  
    65        - name: Send coverage to Coveralls
    66          if: ${{ runner.os != 'Windows' }}
    67          working-directory: ${{env.SRC_DIR}}
    68          env:
    69            COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    70          run: goveralls -service github -coverprofile coverage.txt
    71  
    72        - name: Set up Node.js
    73          if: ${{ runner.os != 'Windows' }}
    74          uses: actions/setup-node@v1
    75          with:
    76            node-version: '14.x'
    77  
    78        - name: Install codeclimate-test-reporter
    79          if: ${{ runner.os != 'Windows' }}
    80          run: npm install -g codeclimate-test-reporter
    81  
    82        - name: Send coverage to Codebeat
    83          if: ${{ runner.os != 'Windows' }}
    84          working-directory: ${{env.SRC_DIR}}
    85          env:
    86            CODECLIMATE_API_HOST: https://codebeat.co/webhooks/code_coverage
    87            CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
    88          run: codeclimate-test-reporter < coverage.txt