Skip to content

Commit 6aace5f

Browse files
Init project
0 parents  commit 6aace5f

File tree

474 files changed

+48035
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

474 files changed

+48035
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[Bugs] Error when getting hits result"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Package (please complete the following information):**
27+
- OS: [e.g. Windows, Linux]
28+
- Version and Dependencies version [e.g. 1.0.0 with CMS version 12.0.1]
29+
30+
**Additional context**
31+
Add any other context about the problem here.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[Feature] Your ideas for the feature"
5+
labels: help wanted
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/actions/env/action.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: 'Apply versioning'
2+
description: 'Get packages version'
3+
inputs:
4+
publishPackages:
5+
description: "Set publish packages"
6+
required: false
7+
default: "False"
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Get version
12+
shell: powershell
13+
id: set_vars
14+
run: |
15+
$branchName=$env:GITHUB_REF_NAME
16+
$buildCounter=$env:GITHUB_RUN_NUMBER
17+
$publishPackages="${{ inputs.publishPackages }}"
18+
19+
if (!$branchName -or !$buildCounter) {
20+
Write-Error "`$branchName and `$buildCounter parameters must be supplied"
21+
exit 1
22+
}
23+
24+
Function GetVersion($path) {
25+
[xml] $versionFile = Get-Content $path
26+
return $versionFile.SelectSingleNode("Project/PropertyGroup/VersionPrefix").InnerText
27+
}
28+
29+
$assemblyVersion = GetVersion "msbuild/version.props"
30+
31+
if (!$assemblyVersion) {
32+
$assemblyVersion = "1.0.0"
33+
}
34+
35+
switch -wildcard ($branchName) {
36+
"main" {
37+
$preReleaseInfo = ""
38+
$publishPackages = "True"
39+
}
40+
"master" {
41+
$preReleaseInfo = ""
42+
$publishPackages = "True"
43+
}
44+
"develop" {
45+
$preReleaseInfo = "-inte-{0:D6}"
46+
$publishPackages = "True"
47+
}
48+
"bugfix/*" {
49+
$preReleaseInfo = "-ci-{0:D6}"
50+
$publishPackages = "True"
51+
}
52+
"hotfix/*" {
53+
$preReleaseInfo = ""
54+
$publishPackages = "True"
55+
}
56+
"release/*" {
57+
$preReleaseInfo = "-pre-{0:D6}"
58+
$publishPackages = "True"
59+
}
60+
"feature/*" {
61+
$isMatch = $branchName -match ".*/([A-Z]+-[\d]+)-"
62+
if ($isMatch -eq $TRUE) {
63+
$feature = $Matches[1]
64+
$preReleaseInfo = "-feature-$feature-{0:D6}"
65+
$publishPackages = "True"
66+
}
67+
else {
68+
$preReleaseInfo = "-feature-{0:D6}"
69+
}
70+
}
71+
default { $preReleaseInfo = "-ci-{0:D6}" }
72+
}
73+
74+
$informationalVersion = "$assemblyVersion$preReleaseInfo" -f $buildCounter
75+
76+
"AssemblyVersion: $assemblyVersion"
77+
"AssemblyInformationalVersion: $informationalVersion"
78+
79+
##Set environment variable for GitHub Actions
80+
"releaseVersion=$assemblyVersion" >> $env:GITHUB_ENV
81+
"packageVersion=$informationalVersion" >> $env:GITHUB_ENV
82+
"publishPackages=$publishPackages" >> $env:GITHUB_ENV
83+
"release_sha=$(git rev-parse HEAD)" >> $env:GITHUB_ENV
84+
85+
#Set DNX_BUILD_VERSION for dnx compiling (without dash)
86+
$dnxPreReleaseInfo = ""
87+
if ($preReleaseInfo.Length -gt 0) {
88+
$dnxPreReleaseInfo = ($preReleaseInfo.Substring(1)) -f $buildCounter
89+
}
90+
91+
##Set environment variable for GitHub Actions
92+
"buildSuffix=$dnxPreReleaseInfo" >> $env:GITHUB_ENV
93+
"DNX_BUILD_VERSION=$dnxPreReleaseInfo" >> $env:GITHUB_ENV

.github/actions/setup/action.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'Setup environment'
2+
description: 'Setup test environment'
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Add msbuild to PATH
8+
uses: microsoft/[email protected]
9+
with:
10+
vs-version: '[16, 18)'
11+

.github/workflows/ci.yml

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Automation Test
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
runUnitTest:
7+
type: boolean
8+
description: Run Unit Tests
9+
default: true
10+
11+
runIntergrationTest:
12+
type: boolean
13+
description: Run Intergrations Tests
14+
default: true
15+
16+
pull_request:
17+
branches:
18+
- develop
19+
- main
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
env:
26+
WindowsSDKPath: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
27+
28+
jobs:
29+
manageVariable:
30+
name: Manage Variables
31+
runs-on: windows-latest
32+
outputs:
33+
packageVersion: ${{ env.packageVersion }}
34+
publishPackages: ${{ env.publishPackages }}
35+
steps:
36+
- name: Checkout source code
37+
uses: actions/checkout@v3
38+
39+
- name: Apply versioning
40+
if: success()
41+
uses: ./.github/actions/env
42+
43+
- name: Package information
44+
run: |
45+
Write-Host "Release version: ${{ env.releaseVersion }}"
46+
Write-Host "Package version: ${{ env.packageVersion }}"
47+
Write-Host "Publish package: ${{ env.publishPackages }}"
48+
Write-Host "Build Suffix: ${{ env.buildSuffix }}"
49+
Write-Host "DNX_BUILD_VERSION: ${{ env.DNX_BUILD_VERSION }}"
50+
Write-output "::notice title=Build branch::${{ github.ref_name }}"
51+
Write-output "::notice title=Release version::${{ env.releaseVersion }}"
52+
Write-output "::notice title=Packages version::${{ env.packageVersion }}"
53+
Write-output "::notice title=Publish packages::${{ env.publishPackages }}"
54+
55+
unit_test:
56+
needs: [manageVariable]
57+
name: Unit test
58+
if: github.event_name == 'pull_request' || ${{ github.event.inputs.runUnitTest == 'true' }}
59+
uses: ./.github/workflows/unitTest.yml
60+
61+
intergration_test:
62+
needs: [manageVariable]
63+
name: Intergrations Test
64+
if: github.event_name == 'pull_request' || ${{ github.event.inputs.runIntergrationTest == 'true' }}
65+
uses: ./.github/workflows/intergrationTest.yml
66+
secrets:
67+
GATEWAYADDRESS: ${{ secrets.GATEWAYADDRESS }}
68+
APPKEY: ${{ secrets.APPKEY }}
69+
SECRET: ${{ secrets.SECRET }}
70+
SINGLEKEY: ${{ secrets.SINGLEKEY }}
71+
72+
label:
73+
name: 🏷️ label
74+
runs-on: ubuntu-latest
75+
if: github.event_name == 'pull_request'
76+
77+
needs: [unit_test, intergration_test] #this ensures that we only trigger the label job if ci is successful
78+
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v3
82+
- name: Set Variables
83+
run: |
84+
if [[ $GITHUB_BASE_REF = 'develop' ]]
85+
then
86+
echo "prLables=develop" >> $GITHUB_ENV
87+
echo ${{ env.prLables }}
88+
else
89+
echo "prLables=release" >> $GITHUB_ENV
90+
echo ${{ env.prLables }}
91+
fi
92+
93+
- name: Lable pull request
94+
uses: actions/github-script@v3
95+
with:
96+
github-token: ${{ secrets.GITHUB_TOKEN }}
97+
script: |
98+
github.issues.addLabels({
99+
issue_number: context.issue.number,
100+
owner: context.repo.owner,
101+
repo: context.repo.repo,
102+
labels: ['${{ env.prLables }}']
103+
})
104+
105+
comment:
106+
name: ✍️ comment
107+
runs-on: ubuntu-latest
108+
if: github.event_name == 'pull_request'
109+
110+
needs: [label]
111+
112+
steps:
113+
- name: Checkout
114+
uses: actions/checkout@v2
115+
- name: Comment on the result
116+
uses: actions/github-script@v3
117+
with:
118+
github-token: ${{ secrets.GITHUB_TOKEN }}
119+
script: |
120+
github.issues.createComment({
121+
issue_number: context.issue.number,
122+
owner: context.repo.owner,
123+
repo: context.repo.repo,
124+
body: `
125+
Great job **@${context.payload.sender.login}**! Your CI passed, and the PR has been automatically labelled.
126+
127+
Once ready, we will merge this PR to trigger the next part of the automation :rocket:
128+
`
129+
})

0 commit comments

Comments
 (0)