-
Notifications
You must be signed in to change notification settings - Fork 25
83 lines (73 loc) · 2.34 KB
/
test-build.yml
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
name: Test Build
on:
workflow_dispatch:
pull_request:
jobs:
update-cli-docs:
runs-on: ubuntu-latest
container:
image: techallylw/ally-releases:1.21.0
strategy:
matrix:
go-version: ['1.21.x']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 1
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Run linting tests
id: update
run: |
git config --global --add safe.directory "${{ github.workspace }}"
make prepare
make lint
make fmt-check
make imports-check
- name: Run unit tests
run: |
make coverage-ci
- name: Build cross-platform binaries
run: |
make build-cli-cross-platform
- name: Run integration tests
run: |
sudo apt-get update
sudo apt-get install -y vim
make integration-only
- name: Trigger release
if: github.ref == 'refs/heads/main'
env:
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
run: |
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes
scripts/release.sh trigger
- name: Notify Slack on Failure
uses: slackapi/slack-github-action@v1.25.0
if: failure() && github.ref == 'refs/heads/main'
with:
payload: |
{
"attachments": [
{
"color": "#E92020",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*GitHub Workflow Failure*\ngo-sdk/test-build\n*Workflow Run*\n https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}\n@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:"
}
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GROWTH_ENG_ALERTS }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK