From 91581ece6e802e295a2311045c00dc494797a73f Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sun, 19 Apr 2020 16:43:38 +0100 Subject: [PATCH] Tidy up GitHub Actions --- .github/workflows/main.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f1cf93adeb3..528b60d2e55 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,10 @@ +name: Test and release on: pull_request: push: jobs: test: + name: Test strategy: matrix: go-version: @@ -38,7 +40,7 @@ jobs: - name: Run run: go run . --version - name: Test - run: go test ./... # FIXME add -race when https://github.com/etcd-io/bbolt/issues/187 is fixed + run: go test -race ./... - name: Lint if: matrix.os == 'ubuntu-latest' run: $(go env GOPATH)/bin/golangci-lint run @@ -57,10 +59,10 @@ jobs: - name: Test release if: matrix.os == 'ubuntu-latest' run: | + export PATH=$PATH:/snap/bin sudo chown root:root / sudo snap install goreleaser --classic sudo snap install snapcraft --classic - export PATH=$PATH:/snap/bin goreleaser release --skip-publish --snapshot # verify that version information is embedded correctly ./dist/chezmoi-cgo_linux_amd64/chezmoi --version | tee /dev/stderr | grep -q "chezmoi version v" @@ -68,6 +70,7 @@ jobs: ./dist/chezmoi-nocgo_linux_386/chezmoi --version | tee /dev/stderr | grep -q "chezmoi version v" ./dist/chezmoi-nocgo-snap_linux_386/chezmoi --version | tee /dev/stderr | grep -q "chezmoi version v" release: + name: Release if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') needs: - test @@ -85,6 +88,7 @@ jobs: env: SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }} run: | + export PATH=$PATH:/snap/bin sudo snap install snapcraft --classic sudo chown root:root / echo ${SNAPCRAFT_LOGIN} | snapcraft login --with - @@ -92,5 +96,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} run: | + export PATH=$PATH:/snap/bin sudo snap install goreleaser --classic goreleaser release \ No newline at end of file