forked from konflux-ci/multi-platform-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.44 KB
/
Copy pathmpc-test.yaml
File metadata and controls
48 lines (43 loc) · 1.44 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
name: Validate PR - Testing Phase - golang CI
on:
pull_request:
types:
- opened
- synchronize
- reopened
branches: [ main ]
merge_group:
types: [checks_requested]
push:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.pull_request.number) || github.ref }}
cancel-in-progress: true
jobs:
checkout_and_test:
name: Golang Unit tests
runs-on: ubuntu-latest
steps:
- name: Determine workflow run event context
run: echo "on-event=${{ github.event_name }}" >> $GITHUB_ENV
- name: Handle invalid context for pull requests
if: ${{ env.on-event == 'pull_request' && (!github.event.pull_request.head.sha || !github.event.pull_request.number) }}
run: |
echo "Invalid context for this workflow run. Exiting."
exit 1
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version-file: "./go.mod"
- name: Build
run: make build
- name: Test
run: make test
- name: Upload to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit-tests
files: cover.out