-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (74 loc) · 2.44 KB
/
test.yaml
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
name: Test Code
# yamllint disable rule:line-length
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
- "releases/**"
paths:
- "**.go"
- "**go.mod"
- "**go.sum"
- ".github/workflows/**"
- "Makefile"
- "images/builder/**"
- "images/**"
- "test/releases/**"
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true
jobs:
test:
name: Test Code
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Coverage result name
id: name
run: |
if [ ${{ github.event.pull_request }} ]; then
NAME=pr-${{ github.event.pull_request.number }}
else
NAME=${{ github.sha }}
fi
echo name=${NAME} >> $GITHUB_OUTPUT
- name: Setup Go
uses: ./.github/actions/setup-go
- name: Install dependencies
run: make gotestsum go-cover-treemap setup-envtest
- name: Install go modules for test
shell: bash
run: |
go mod download
- name: Running unit tests
run: make test-unit
- name: Running integration tests
env:
GIT_PROVIDER: github
GIT_ORG_NAME: SovereignCloudStack
GIT_REPOSITORY_NAME: cluster-stacks
GIT_ACCESS_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
ENCODED_CLOUDS_YAML: ${{ secrets.ENCODED_CLOUDS_YAML }}
# OCI_REGISTRY: registry.scs.community
# OCI_REPOSITORY: registry.scs.community/csctl-oci/openstack
run: make test-integration
# - name: Create Report
# run: make report-cover-html report-cover-treemap
# - name: Test Summary
# uses: test-summary/action@62bc5c68de2a6a0d02039763b8c754569df99e3f # v2.1
# with:
# paths: ".coverage/junit.xml"
# - name: Upload Report
# uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
# with:
# name: reports-${{ steps.name.outputs.name }}
# path: .reports
# retention-days: 30