aboutsummaryrefslogblamecommitdiffstats
path: root/.github/workflows/test.yml
blob: 2aece2f99c67a3cc5d4f7960f2e84f45c93d43de (plain) (tree)
1
2
3
4
5
6
7
8
9


                        
                 
             
                      
             
                                    
                                                               
    




                                   

                                               

                               











                                                        
                














                                                                              
on: [push, pull_request]
name: Test
jobs:
  version-matrix:
    strategy:
      fail-fast: false
      matrix:
        go-version: [1.13.x, 1.14.x]
        platform: [ubuntu-latest, macos-latest, windows-latest]
    
    runs-on: ${{ matrix.platform }}
    steps:
    - name: Install Go
      uses: actions/setup-go@v1
      with:
        go-version: ${{ matrix.go-version }}   

    - name: Checkout code
      uses: actions/checkout@v2
  
    - name: Configure known hosts
      if: matrix.platform != 'ubuntu-latest'
      run: |
        mkdir -p  ~/.ssh
        ssh-keyscan -H github.com > ~/.ssh/known_hosts

    - name: Set Git config
      run: |
        git config --global user.email "gha@example.com"
        git config --global user.name "GitHub Actions"

    - name: Test
      run: make test-coverage

    - name: Convert coverage to lcov
      if: matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.14.x' 
      uses: jandelgado/gcov2lcov-action@v1.0.0
      with:
          infile: coverage.out
          outfile: coverage.lcov

    - name: Coveralls
      if: matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.14.x' 
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        path-to-lcov: coverage.lcov