name: Test on: workflow_dispatch: push: branches: - releases/v5.x - main pull_request: permissions: {} jobs: test: strategy: fail-fast: false matrix: go-version: [oldstable, stable] platform: [ubuntu-latest, macos-latest, windows-latest] permissions: contents: read runs-on: ${{ matrix.platform }} steps: - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Install Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: go-version: ${{ matrix.go-version }} - name: Configure known hosts continue-on-error: true 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: Test Examples run: go test -timeout ${{ matrix.platform == 'windows-latest' && '60s' || '30s' }} -v -run '^TestExamples$' github.com/go-git/go-git/v5/_examples --examples