Skip to content

Commit

Permalink
Merge pull request #686 from twpayne/tidy-up-github-action
Browse files Browse the repository at this point in the history
Tidy up GitHub Actions
  • Loading branch information
twpayne committed Apr 19, 2020
2 parents f642fb4 + 91581ec commit 017a83f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Test and release
on:
pull_request:
push:
jobs:
test:
name: Test
strategy:
matrix:
go-version:
Expand Down Expand Up @@ -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
Expand All @@ -57,17 +59,18 @@ 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"
./dist/chezmoi-cgo_linux_amd64/chezmoi --version | tee /dev/stderr | grep -q "chezmoi version v"
./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
Expand All @@ -85,12 +88,14 @@ 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 -
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
run: |
export PATH=$PATH:/snap/bin
sudo snap install goreleaser --classic
goreleaser release

0 comments on commit 017a83f

Please sign in to comment.