-
Notifications
You must be signed in to change notification settings - Fork 16
107 lines (95 loc) · 3.67 KB
/
ci-coordinator.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Coordinate NFP-DRV-KMODS Workflows
# ========== TRIGGER ==========
on:
push:
branches:
- '*-main' # Branch name ending with '-main'. e.g, public-main, <customer>-main
- '!testing-main' # Exclude this specific branch
- '!sgw-sdk-main' # Exclude this specific branch
- '!wip-*' # Exclude any wip branch
- 'test-*' # Temporary test build
- 'build-*' # Temporary build, no testing
tags:
- '*-prerelease-[0-9][0-9].[0-9][0-9].[0-9]-rc[0-9]' # Customer Prerelease tag
- '*-release-[0-9][0-9].[0-9][0-9].[0-9]' # Customer Release tag
- 'prerelease-[0-9][0-9].[0-9][0-9].[0-9]-rc[0-9]' # Prerelease tag
- 'release-[0-9][0-9].[0-9][0-9].[0-9]' # Release tag
workflow_dispatch:
jobs:
package_dkms:
uses: ./.github/workflows/create-packages.yaml
secrets:
AZ_SAS_TOK: ${{ secrets.AZ_SAS_TOK }}
GHUB_TOKEN: ${{ secrets.GHUB_TOKEN }}
package_rpm:
if: contains(github.ref_name, 'release-')
needs: package_dkms
uses: ./.github/workflows/package-rpm.yaml
with:
driver_build_type: >-
${{ contains(github.ref, 'prerelease') && 'prereleases' || 'releases' }}
customer: '${{ needs.package_dkms.outputs.customer_name }}'
driver: '${{ needs.package_dkms.outputs.tgz_name }}'
driver_upload_location: default
target_distro: all
target_arch: all
secrets:
AZ_SAS_TOK: ${{ secrets.AZ_SAS_TOK }}
GHUB_TOKEN: ${{ secrets.GHUB_TOKEN }}
install_dkms_packages:
needs: package_dkms
uses: ./.github/workflows/ci-test-interop.yaml
secrets:
AZ_SAS_TOK: ${{ secrets.AZ_SAS_TOK }}
GHUB_TOKEN: ${{ secrets.GHUB_TOKEN }}
status-check:
needs:
- package_dkms
- install_dkms_packages
runs-on:
- self-hosted
- ci-linter-vm
if: >-
always() &&
(((github.head_ref || github.ref_name) == '*-main')
|| contains(github.ref_name, 'release-')
|| contains(github.ref_name, 'prerelease-'))
steps:
- name: Clean old artifacts
run: sudo find -delete
- name: Checkout provisioning repo
uses: Corigine/ci-libs/github_actions/utilities/checkout_corigine@main
with:
repository: Corigine/ci-libs
token: ${{ secrets.GHUB_TOKEN }}
path: ci-libs
- name: Get all job statuses
id: all_statuses
shell: python3 {0}
run: |
import os
import json
import sys
statusMatrix = {}
if "${{ needs.package_dkms.result }}" == "failure" \
or "${{ needs.install_dkms_packages.result }}" == "failure":
statusMatrix['status'] = "FAILED"
else:
statusMatrix['status'] = "SUCCESSFUL"
statusMatrix['branch'] = "${{ github.head_ref || github.ref_name }}"
statusMatrix['package_dkms'] = "${{ needs.package_dkms.result }}"
statusMatrix['install_dkms_packages'] = "${{ needs.install_dkms_packages.result }}"
statusMatrix['url'] = ("${{ github.event.repository.html_url }}/"
"actions/runs/${{ github.run_id }}")
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write('status<<EOF\n')
f.write(json.dumps(statusMatrix, indent=4))
f.write('\n')
f.write('EOF\n')
- name: Check the status of the release
uses: ./ci-libs/github_actions/utilities/send_to_zabbix
with:
zabbix_server: ${{ secrets.ZABBIX_SERVER }}
host: ${HOSTNAME}
item_key: "driver_release_status"
data: ${{ steps.all_statuses.outputs.status }}