-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 1.95 KB
/
Copy pathtest.yml
File metadata and controls
67 lines (65 loc) · 1.95 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
name: test
on:
workflow_call:
secrets:
SLACK_WEBHOOK_URL:
required: true
jobs:
test-and-build:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.19
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Use Cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
go mod download
go install github.com/onsi/ginkgo/v2/ginkgo@$(go list -f '{{.Version}}' -m github.com/onsi/ginkgo/v2 || echo 'LOOKUP-VERSION-FAILED')
- name: Run Test
id: unittest
run: |
make test
- name: Upload coverage report
uses: codecov/codecov-action@v2
with:
files: ./coverprofile.out
fail_ci_if_error: true
verbose: true
if: ${{ steps.unittest.conclusion == 'success' || steps.unittest.conclusion == 'failure' }}
- name: Build
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: build --snapshot --rm-dist
- name: Run E2E Test
run: |
gh release download --pattern spexec-linux-amd64.tar.gz -D /tmp
tar -x -C /tmp -f /tmp/spexec-linux-amd64.tar.gz
E2E_SPEXEC=/tmp/spexec-linux-amd64/spexec make e2e
- name: Save Artifact
uses: actions/upload-artifact@v2
with:
name: artifact
path: ${{ github.workspace }}/dist/*/spexec
- name: Notify to Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,took,workflow,job,ref,message
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure() || cancelled()