Skip to content

Commit

Permalink
Merge pull request #114 from maxatome/action-tip
Browse files Browse the repository at this point in the history
test: Build action now uses maxatome/install-go
  • Loading branch information
maxatome committed Nov 23, 2020
2 parents f486aae + 3bc5520 commit 6ae744a
Showing 1 changed file with 12 additions and 34 deletions.
46 changes: 12 additions & 34 deletions .github/workflows/ci.yml
Expand Up @@ -22,72 +22,50 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Go version
- name: Setup go
run: |
if [ ${{ matrix.go-version }} = tip ]; then
version=$GO_CURRENT
echo "Using gotip via go $version"
else
version=${{ matrix.go-version }}
echo "Using go $version"
fi
go version
echo ::set-output name=go_version::$version
- name: Install go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.vars.outputs.go_version }}

- name: Install gotip
if: matrix.go-version == 'tip'
continue-on-error: true
run: |
go get golang.org/dl/gotip
$(go env GOPATH)/bin/gotip download
curl -sL https://raw.githubusercontent.com/maxatome/install-go/env/install-go.pl |
perl - ${{ matrix.go-version }} $HOME/go
- name: Checkout code
uses: actions/checkout@v2

- name: Linting
if: matrix.full-tests
run: |
mkdir /tmp/linter-bin
wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh |
sh -s -- -b /tmp/linter-bin v1.30.0
/tmp/linter-bin/golangci-lint run -E gofmt -E golint -E maligned -E misspell -E prealloc -E unconvert -E whitespace -E goimports ./...
sh -s -- -b $HOME/go/bin v1.33.0
echo $PATH
$HOME/go/bin/golangci-lint run -E gofmt -E golint -E maligned -E misspell -E prealloc -E unconvert -E whitespace -E goimports ./...
- name: Testing
continue-on-error: ${{ matrix.go-version == 'tip' }}
run: |
go version
if [ ${{ matrix.full-tests }} = true ]; then
GO_TEST_SAFE_FLAGS="-covermode=atomic -coverprofile=coverage-safe.out"
GO_TEST_UNSAFE_FLAGS="-covermode=atomic -coverprofile=coverage-unsafe.out"
fi
PATH=$PATH:$(go env GOPATH)/bin
go=go
case ${{ matrix.go-version }} in
tip) go=gotip ;;
1.9.x | 1.10.x) # Before go 1.11, go modules are not available
mkdir -p ../src/github.com/maxatome
ln -s $(pwd) ../src/github.com/maxatome/go-testdeep
ln -s $(pwd) ../src/github.com/$GITHUB_REPOSITORY
export GOPATH=$(dirname $(pwd))
cd $GOPATH/src/github.com/maxatome/go-testdeep
cd $GOPATH/src/github.com/$GITHUB_REPOSITORY
;;
esac
export GORACE="halt_on_error=1"
$go get -t ./...
$go test -race -tags safe $GO_TEST_SAFE_FLAGS ./...
$go test -race $GO_TEST_UNSAFE_FLAGS ./...
go get -t ./...
go test -race -tags safe $GO_TEST_SAFE_FLAGS ./...
go test -race $GO_TEST_UNSAFE_FLAGS ./...
- name: Reporting
if: matrix.full-tests
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PATH=$PATH:$(go env GOPATH)/bin
go get github.com/mattn/goveralls
go get github.com/wadey/gocovmerge
gocovmerge coverage-safe.out coverage-unsafe.out > coverage.out
Expand Down

0 comments on commit 6ae744a

Please sign in to comment.