forked from devbuddy/devbuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (75 loc) · 2.05 KB
/
tests.yml
File metadata and controls
85 lines (75 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: tests
on:
repository_dispatch: null
workflow_dispatch:
env:
TEST_DOCKER_IMAGE: ghcr.io/devbuddy/docker-testing:sha-f11e362
jobs:
linters:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.43
tests:
name: go test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: "1.17.x"
- run: go test -timeout 10s -cover ./pkg/...
tests-bash:
name: bash tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: "1.17.x"
- run: docker pull $TEST_DOCKER_IMAGE
- run: TEST_SHELL=bash go test -cover -v ./tests
tests-zsh:
name: zsh tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: "1.17.x"
- run: docker pull $TEST_DOCKER_IMAGE
- run: TEST_SHELL=zsh go test -cover -v ./tests
release:
name: release
needs: [linters, tests, tests-bash, tests-zsh]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: "1.17.x"
- run: script/buildall
- run: ls -l dist
- run: grep . dist/*.sha256
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: dist/*
prerelease: false
- name: Trigger action in homebrew-devbuddy
uses: mvasigh/dispatch-action@main
with:
token: ${{ secrets.ACCESS_TOKEN }}
repo: homebrew-devbuddy
owner: devbuddy
event_type: upgrade
message: |
{
"version": "${{ github.ref_name }}",
"revision": "${{ github.sha }}"
}