-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (140 loc) · 5.57 KB
/
build.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Build and Test
on:
push:
branches-ignore:
- release
tags-ignore: [ '**' ]
jobs:
versionning:
name: Versionning
runs-on: ubuntu-latest
outputs:
version: ${{ steps.genver.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Generate Version
id: genver
uses: codacy/git-version@80c816f11db8dea5e3a81025f598193015b51832 # 2.8.0
with:
minor-identifier: "feat:"
release-branch: release
dev-branch: main
- name: Print version
run: echo VERSION ${{ steps.genver.outputs.version }} >> $GITHUB_STEP_SUMMARY
unitTest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ github.ref }}
submodules: true
- name: Run tests
run: |
cd test/ReRunnerAgentTest/
dotnet test --logger "trx;LogFileName=test-results.trx" -p:RunAnalyzers=false -p:WarningLevel=0
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test - ubuntu test/ReRunnerAgentTest/
path: test/ReRunnerAgentTest/TestResults/test-results.trx
reporter: dotnet-trx
testTaskDumper:
runs-on: ubuntu-latest
needs:
- versionning
strategy:
fail-fast: false
matrix:
scenario:
- ""
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ github.ref }}
- name: Install Dependencies
uses: aneoconsulting/ArmoniK.Action.Deploy/dependencies@main
with:
docker: true
terraform: true
k3s: true
aws: true
- name: Checkout Infra
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
repository: aneoconsulting/ArmoniK
path: infra
- id: deploy
name: Deploy
uses: aneoconsulting/ArmoniK.Action.Deploy/deploy@main
with:
working-directory: ${{ github.workspace }}/infra
type: localhost
ext-csharp-version: 0.18.0
core-version: 0.25.0
- name: Run HtcMock Client
run: |
export CPIP=$(kubectl get svc control-plane -n armonik -o custom-columns="IP:.spec.clusterIP" --no-headers=true)
export CPPort=$(kubectl get svc control-plane -n armonik -o custom-columns="PORT:.spec.ports[*].port" --no-headers=true)
export Grpc__Endpoint=http://$CPIP:$CPPort
echo "CPPort=$CPPort" >> $GITHUB_ENV
echo "CPIP=$CPIP" >> $GITHUB_ENV
echo "Grpc__Endpoint=$Grpc__Endpoint" >> $GITHUB_ENV
docker run --rm -e HtcMock__NTasks=100 -e HtcMock__TotalCalculationTime=00:00:00.100 -e HtcMock__DataSize=1 -e HtcMock__MemorySize=1 -e HtcMock__PurgeData=false -e HtcMock__EnableFastCompute=true -e HtcMock__SubTasksLevels=4 -e HtcMock__Partition=htcmock -e HtcMock__TaskError="6" -e GrpcClient__Endpoint=$Grpc__Endpoint dockerhubaneo/armonik_core_htcmock_test_client:$(jq -r ".armonik_versions.core" infra/versions.tfvars.json) || true
- name: Retrieve TaskID
run: |
sudo apt install python3-venv
git clone https://github.com/aneoconsulting/ArmoniK.Admin.CLI.git
cd ArmoniK.Admin.CLI
python -m venv ./venv
source ./venv/bin/activate
pip install build
python -m build
pip install dist/*.whl
export SESSIONID=$(armonik_admin_cli --endpoint ${{ env.CPIP }}:${{ env.CPPort }} list-session --all | sed -n 's/Session ID: //p')
export TASKID=$(armonik_admin_cli --endpoint ${{ env.CPIP }}:${{ env.CPPort }} list-task $SESSIONID --error | head -n 1 | awk '{print $3}')
echo "taskId=$TASKID" >> $GITHUB_ENV
- name: Run TaskDumper
working-directory: src/TaskDumper
run: |
dotnet run --endpoint ${{ env.Grpc__Endpoint }} --taskId ${{ env.taskId }} --dataFolder /tmp/test
- name: Run Worker HtcMock
run: |
mkdir /tmp/sockets
chmod 777 /tmp/sockets
docker run --rm -d --name htcmock -u $(id -u) -e ComputePlane__WorkerChannel__Address=/cache/worker.sock -e ComputePlane__AgentChannel__Address=/cache/agent.sock -v /tmp/sockets:/cache -v /tmp/Results:/tmp/Results dockerhubaneo/armonik_core_htcmock_test_worker:0.25.0
- name: Run TaskReRunner
working-directory: src/TaskReRunner
run: |
dotnet run --path /tmp/test/Task.json
publish-nuget:
strategy:
matrix:
projects:
- src/TaskReRunner/ArmoniK.TaskReRunner.csproj
- src/TaskDumper/ArmoniK.TaskDumper.csproj
fail-fast: false
runs-on: ubuntu-latest
needs:
- versionning
env:
VERSION: ${{ needs.versionning.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ github.ref }}
- name: Build the package
run: |
dotnet build ${{ matrix.projects }} -c Release -p:RunAnalyzers=false -p:WarningLevel=0
- name: Pack the package
run: |
dotnet pack ${{ matrix.projects }} -c Release -o /tmp/packages -p:PackageVersion=$VERSION -p:Version=$VERSION
- name: Push the package
run: dotnet nuget push /tmp/packages/ArmoniK.*.nupkg -k ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json