fix: check attr is nil prior going copy (#74) #150
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: golang | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git fetch --prune --unshallow | |
- name: Setup env | |
uses: HatsuneMiku3939/direnv-action@v1 | |
- run: | | |
toolchain=$(cat go.mod | grep toolchain | cut -d ' ' -f 2 | sed 's/go*//') | |
echo "GOTOOLCHAIN=go${toolchain}" >> $GITHUB_ENV | |
echo "GOVERSION=${toolchain}" >> $GITHUB_ENV | |
echo "GOROOT=/opt/hostedtoolcache/go/${toolchain}/x64" >> $GITHUB_ENV | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: "${{ env.GOVERSION }}" | |
- run: TEST_RACE=1 make test | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git fetch --prune --unshallow | |
- name: Setup env | |
uses: HatsuneMiku3939/direnv-action@v1 | |
- run: | | |
toolchain=$(cat go.mod | grep toolchain | cut -d ' ' -f 2 | sed 's/go*//') | |
echo "GOTOOLCHAIN=go${toolchain}" >> $GITHUB_ENV | |
echo "GOVERSION=${toolchain}" >> $GITHUB_ENV | |
echo "GOROOT=/opt/hostedtoolcache/go/${toolchain}/x64" >> $GITHUB_ENV | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: "${{ env.GOVERSION }}" | |
- run: make test-coverage | |
- uses: codecov/codecov-action@v3 |