Skip to content

Commit 017a83f

Browse files
authored
Merge pull request #686 from twpayne/tidy-up-github-action
Tidy up GitHub Actions
2 parents f642fb4 + 91581ec commit 017a83f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
name: Test and release
12
on:
23
pull_request:
34
push:
45
jobs:
56
test:
7+
name: Test
68
strategy:
79
matrix:
810
go-version:
@@ -38,7 +40,7 @@ jobs:
3840
- name: Run
3941
run: go run . --version
4042
- name: Test
41-
run: go test ./... # FIXME add -race when https://github.com/etcd-io/bbolt/issues/187 is fixed
43+
run: go test -race ./...
4244
- name: Lint
4345
if: matrix.os == 'ubuntu-latest'
4446
run: $(go env GOPATH)/bin/golangci-lint run
@@ -57,17 +59,18 @@ jobs:
5759
- name: Test release
5860
if: matrix.os == 'ubuntu-latest'
5961
run: |
62+
export PATH=$PATH:/snap/bin
6063
sudo chown root:root /
6164
sudo snap install goreleaser --classic
6265
sudo snap install snapcraft --classic
63-
export PATH=$PATH:/snap/bin
6466
goreleaser release --skip-publish --snapshot
6567
# verify that version information is embedded correctly
6668
./dist/chezmoi-cgo_linux_amd64/chezmoi --version | tee /dev/stderr | grep -q "chezmoi version v"
6769
./dist/chezmoi-cgo_linux_amd64/chezmoi --version | tee /dev/stderr | grep -q "chezmoi version v"
6870
./dist/chezmoi-nocgo_linux_386/chezmoi --version | tee /dev/stderr | grep -q "chezmoi version v"
6971
./dist/chezmoi-nocgo-snap_linux_386/chezmoi --version | tee /dev/stderr | grep -q "chezmoi version v"
7072
release:
73+
name: Release
7174
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
7275
needs:
7376
- test
@@ -85,12 +88,14 @@ jobs:
8588
env:
8689
SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }}
8790
run: |
91+
export PATH=$PATH:/snap/bin
8892
sudo snap install snapcraft --classic
8993
sudo chown root:root /
9094
echo ${SNAPCRAFT_LOGIN} | snapcraft login --with -
9195
- name: Release
9296
env:
9397
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
9498
run: |
99+
export PATH=$PATH:/snap/bin
95100
sudo snap install goreleaser --classic
96101
goreleaser release

0 commit comments

Comments
 (0)