-
Notifications
You must be signed in to change notification settings - Fork 3
147 lines (141 loc) · 6.37 KB
/
integration-tests_triggered_by_bo.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Triggered on a schedule and manually via a dispatch event.
# This workflow test if the script is still working with the latest bo versions ('test').
# It also tests custom definable older script versions to determine if they still work
name: Test data upload script, triggered by bo changes or schedule
on:
schedule:
# Executes this workflow on a schedule (always uses the latest version on the default branch
# (see: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule))
# Execution on weekdays at 02:27 UTC
- cron: "27 2 * * 1-5"
workflow_dispatch:
jobs:
# Short test on windows using PS7
integration_test_short_windows_ps7:
name: Short, Windows, PS7, version '${{ matrix.version }}'
runs-on: windows-2019
strategy:
matrix:
version:
- ${{fromJson(vars.VERSION_MATRIX)}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.version }}
- name: Status
run: |
echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
echo "The ${{ github.repository }} repository has been cloned to the runner."
echo "The workflow is now ready to test your code on the runner."
- name: Execute test
shell: pwsh
run: |
echo "Test CSV import"
./business_objects_upload/test/TestWrapperScript.ps1 -short -dbType csv -baseUri ${{ secrets.BO_BASE_URI_TEST }} -apiKey "${{ secrets.BO_API_KEY_TEST }}" -configTemplatePath ./business_objects_upload/test/csv/ScriptConfig.template.json
# Short test on windows using PS5
integration_test_short_windows_ps5:
name: Short, Windows, PS5, version '${{ matrix.version }}'
runs-on: windows-2019
strategy:
matrix:
version:
- ${{fromJson(vars.VERSION_MATRIX)}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.version }}
- name: Status
run: |
echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
echo "The ${{ github.repository }} repository has been cloned to the runner."
echo "The workflow is now ready to test your code on the runner."
- name: Execute test
shell: powershell
run: |
echo "Test CSV import"
./business_objects_upload/test/TestWrapperScript.ps1 -short -dbType csv -baseUri ${{ secrets.BO_BASE_URI_TEST }} -apiKey "${{ secrets.BO_API_KEY_TEST }}" -configTemplatePath ./business_objects_upload/test/csv/ScriptConfig.template.json
# Long test on ubuntu using PS7
integration_test_short_ubuntu_ps7_mssql:
name: Short, Ubuntu, PS7, mssql data source, version '${{ matrix.version }}'
runs-on: ubuntu-20.04
strategy:
matrix:
version:
- ${{fromJson(vars.VERSION_MATRIX)}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.version }}
- name: Status
run: |
echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
echo "The ${{ github.repository }} repository has been cloned to the runner."
echo "The workflow is now ready to test your code on the runner."
- name: Execute test
shell: pwsh
run: |
echo "Test MSSQL import"
./.github/workflows/setup-mssql-db.ps1 -dbPassword ${{ secrets.MSSQL_DB_PASSWORD_TEST }}
./business_objects_upload/test/TestWrapperScript.ps1 -dbPassword ${{ secrets.MSSQL_DB_PASSWORD_TEST }} -dbType mssql -baseUri ${{ secrets.BO_BASE_URI_TEST }} -apiKey "${{ secrets.BO_API_KEY_TEST }}" -configTemplatePath ./business_objects_upload/test/mssql/ScriptConfig.template.json
# Long test on ubuntu using PS7
integration_test_long_ubuntu_ps7:
name: Long, Ubuntu, PS7, version, batching enabled '${{ matrix.version }}'
runs-on: ubuntu-20.04
strategy:
matrix:
version:
- ${{fromJson(vars.VERSION_MATRIX)}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.version }}
- name: Status
run: |
echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
echo "The ${{ github.repository }} repository has been cloned to the runner."
echo "The workflow is now ready to test your code on the runner."
- name: Execute test
shell: pwsh
run: |
echo "Test CSV import"
./business_objects_upload/test/TestWrapperScript.ps1 -dbType csv -baseUri ${{ secrets.BO_BASE_URI_TEST }} -apiKey "${{ secrets.BO_API_KEY_TEST }}" -configTemplatePath ./business_objects_upload/test/csv/ScriptConfig.template.json
# Short test on ubuntu using PS7
integration_test_short_ubuntu_ps7_no_batching:
name: Short, Ubuntu, PS7, version, batching disabled '${{ matrix.version }}'
runs-on: ubuntu-20.04
strategy:
matrix:
version:
- ${{fromJson(vars.VERSION_MATRIX)}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.version }}
- name: Status
run: |
echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
echo "The ${{ github.repository }} repository has been cloned to the runner."
echo "The workflow is now ready to test your code on the runner."
- name: Execute test
shell: pwsh
run: |
echo "Test CSV import"
./business_objects_upload/test/TestWrapperScript.ps1 -short -noBatching -dbType csv -baseUri ${{ secrets.BO_BASE_URI_TEST }} -apiKey "${{ secrets.BO_API_KEY_TEST }}" -configTemplatePath ./business_objects_upload/test/csv/ScriptConfig.template.json
notify-teams:
runs-on: ubuntu-latest
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }}
needs:
[
integration_test_long_ubuntu_ps7,
integration_test_short_windows_ps5,
integration_test_short_windows_ps7,
integration_test_short_ubuntu_ps7_mssql,
integration_test_short_ubuntu_ps7_no_batching,
]
steps:
- uses: actions/checkout@v4
- name: Sending teams notification
run: |
chmod +x ./.github/workflows/notification.sh
echo "Sending teams notification"
./.github/workflows/notification.sh "${{ secrets.POWERAUTOMATE_WEBHOOK_URL }}"