-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (53 loc) · 2.11 KB
/
Copy pathcli-build_test.yml
File metadata and controls
65 lines (53 loc) · 2.11 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
# Copyright (c) Codesphere Inc.
# SPDX-License-Identifier: Apache-2.0
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build & Test CLI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6
with:
go-version-file: 'go.mod'
- name: Build
run: make build-cli
- name: Slack Notification on Failure
if: ${{ failure() && github.ref == 'refs/heads/main' }}
run: |
curl -X POST \
-H 'Content-type: application/json' \
--data '{
"channel": "#team-oms-sdk",
"icon_emoji": ":siren:",
"text": "🚨 Build Job Failure 🚨\nRepository: ${{ github.repository }}\nBranch/Ref: `${{ github.ref }}`\nRun url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
${{ secrets.PACKAGE_JOB_SLACK_WEBHOOK }}
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6
with:
go-version-file: 'go.mod'
- name: Test
run: make test
- name: Slack Notification on Failure
if: ${{ failure() && github.ref == 'refs/heads/main' }}
run: |
curl -X POST \
-H 'Content-type: application/json' \
--data '{
"channel": "#team-oms-sdk",
"icon_emoji": ":siren:",
"text": "🚨 Build Job Failure 🚨\nRepository: ${{ github.repository }}\nBranch/Ref: `${{ github.ref }}`\nRun url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
${{ secrets.PACKAGE_JOB_SLACK_WEBHOOK }}