aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/test.yml
blob: 96090c0b2e1ac4f810e318fd1710bf82ca6c8201 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
on: [push, pull_request]
name: Test
permissions:
  contents: read

jobs:
  version-matrix:
    strategy:
      fail-fast: false
      matrix:
        go-version: [1.20.x, 1.21.x, 1.22.x]
        platform: [ubuntu-latest, macos-latest, windows-latest]
    
    runs-on: ${{ matrix.platform }}
    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Install Go
      uses: actions/setup-go@v5
      with:
        go-version: ${{ matrix.go-version }}   
  
    - 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