-
Notifications
You must be signed in to change notification settings - Fork 3
129 lines (111 loc) · 3.91 KB
/
ci.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Automation Test
on:
workflow_dispatch:
inputs:
runUnitTest:
type: boolean
description: Run Unit Tests
default: true
runIntergrationTest:
type: boolean
description: Run Intergrations Tests
default: true
pull_request:
branches:
- develop
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
WindowsSDKPath: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
jobs:
manageVariable:
name: Manage Variables
runs-on: windows-latest
outputs:
packageVersion: ${{ env.packageVersion }}
publishPackages: ${{ env.publishPackages }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Apply versioning
if: success()
uses: ./.github/actions/env
- name: Package information
run: |
Write-Host "Release version: ${{ env.releaseVersion }}"
Write-Host "Package version: ${{ env.packageVersion }}"
Write-Host "Publish package: ${{ env.publishPackages }}"
Write-Host "Build Suffix: ${{ env.buildSuffix }}"
Write-Host "DNX_BUILD_VERSION: ${{ env.DNX_BUILD_VERSION }}"
Write-output "::notice title=Build branch::${{ github.ref_name }}"
Write-output "::notice title=Release version::${{ env.releaseVersion }}"
Write-output "::notice title=Packages version::${{ env.packageVersion }}"
Write-output "::notice title=Publish packages::${{ env.publishPackages }}"
unit_test:
needs: [manageVariable]
name: Unit test
if: github.event_name == 'pull_request' || ${{ github.event.inputs.runUnitTest == 'true' }}
uses: ./.github/workflows/unitTest.yml
intergration_test:
needs: [manageVariable]
name: Intergrations Test
if: github.event_name == 'pull_request' || ${{ github.event.inputs.runIntergrationTest == 'true' }}
uses: ./.github/workflows/intergrationTest.yml
secrets:
GATEWAYADDRESS: ${{ secrets.GATEWAYADDRESS }}
APPKEY: ${{ secrets.APPKEY }}
SECRET: ${{ secrets.SECRET }}
SINGLEKEY: ${{ secrets.SINGLEKEY }}
label:
name: 🏷️ label
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: [unit_test, intergration_test] #this ensures that we only trigger the label job if ci is successful
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Variables
run: |
if [[ $GITHUB_BASE_REF = 'develop' ]]
then
echo "prLables=develop" >> $GITHUB_ENV
echo ${{ env.prLables }}
else
echo "prLables=release" >> $GITHUB_ENV
echo ${{ env.prLables }}
fi
- name: Lable pull request
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['${{ env.prLables }}']
})
comment:
name: ✍️ comment
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: [label]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Comment on the result
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `
Great job **@${context.payload.sender.login}**! Your CI passed, and the PR has been automatically labelled.
Once ready, we will merge this PR to trigger the next part of the automation :rocket:
`
})