Skip to content

Enable unused and modernize linters #2981

Enable unused and modernize linters

Enable unused and modernize linters #2981

Workflow file for this run

name: Test
on:
workflow_dispatch:
push:
branches:
- releases/v5.x
- main
pull_request:
permissions: {}
jobs:
test:
strategy:
fail-fast: false
matrix:
go-version: [1.24.x, 1.25.x]
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 "[email protected]"
git config --global user.name "GitHub Actions"
- name: Validate
run: make validate
- name: Test
run: make test-coverage
- name: Test Examples
run: go test -timeout 45s -v -run '^TestExamples$' github.com/go-git/go-git/v6/_examples --examples
test-wasi:
strategy:
fail-fast: false
matrix:
go-version: [1.24.x, 1.25.x]
permissions:
contents: read
runs-on: ubuntu-latest
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: Install Wasmtime
uses: bytecodealliance/actions/wasmtime/setup@v1
- name: Build
run: |
GOOS=wasip1 GOARCH=wasm go test -c -o go-git.wasm github.com/go-git/go-git/v6
- name: Test
run: |
wasmtime run go-git.wasm -test.v -test.run '^TestWasmInit$' github.com/go-git/go-git/v6