| 1 |
name: Test |
| 2 |
on: |
| 3 |
workflow_dispatch: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- releases/v5.x |
| 7 |
- main |
| 8 |
pull_request: |
| 9 |
|
| 10 |
permissions: {} |
| 11 |
|
| 12 |
jobs: |
| 13 |
test: |
| 14 |
strategy: |
| 15 |
fail-fast: false |
| 16 |
matrix: |
| 17 |
go-version: [oldstable, stable] |
| 18 |
platform: [ubuntu-latest, macos-latest, windows-latest] |
| 19 |
|
| 20 |
permissions: |
| 21 |
contents: read |
| 22 |
|
| 23 |
runs-on: ${{ matrix.platform }} |
| 24 |
steps: |
| 25 |
- name: Checkout code |
| 26 |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 27 |
|
| 28 |
- name: Install Go |
| 29 |
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 30 |
with: |
| 31 |
go-version: ${{ matrix.go-version }} |
| 32 |
|
| 33 |
- name: Configure known hosts |
| 34 |
continue-on-error: true |
| 35 |
if: matrix.platform != 'ubuntu-latest' |
| 36 |
run: | |
| 37 |
mkdir -p ~/.ssh |
| 38 |
ssh-keyscan -H github.com > ~/.ssh/known_hosts |
| 39 |
|
| 40 |
- name: Set Git config |
| 41 |
run: | |
| 42 |
git config --global user.email "[email protected]" |
| 43 |
git config --global user.name "GitHub Actions" |
| 44 |
|
| 45 |
- name: Test |
| 46 |
run: make test-coverage |
| 47 |
|
| 48 |
- name: Test Examples |
| 49 |
run: go test -timeout ${{ matrix.platform == 'windows-latest' && '60s' || '30s' }} -v -run '^TestExamples$' github.com/go-git/go-git/v5/_examples --examples |