fix(#117): support for XDG_CONFIG_HOME environment variable #610
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
tags: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [ 1.21.x ] | |
os: [ ubuntu-latest, macos-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/checkout@v3 | |
- run: | | |
export XDG_CONFIG_HOME="" | |
go test -coverprofile=coverage.out -coverpkg=./... -covermode=count ./internal/... | |
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}') | |
echo "Total coverage: $COVERAGE" | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
if: matrix.os == 'ubuntu-latest' | |
- name: Run BATS tests | |
uses: mig4/setup-bats@v1 | |
with: | |
bats-version: 1.9.0 | |
- run: | | |
make build | |
bats bats/test.bats | |
test_windows: | |
strategy: | |
matrix: | |
go-version: [ 1.21.x ] | |
os: [ windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/checkout@v3 | |
- run: | | |
go test ./internal/... |