-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (128 loc) · 5.55 KB
/
generate-reference.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
name: Reference generation
on:
# Manual launch
workflow_dispatch:
inputs:
release_tag:
description: "Release tag"
required: true
release_name:
description: "Release name"
required: true
antares_tag:
description: "Antares_Simulator solver tag"
default: v8.0.3
required: true
antares_tests_tag:
description: "Antares_Simulator_Tests_NR"
default: v8.0.0
required: true
jobs:
release:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Release creation
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.release_tag }}
release_name: ${{ github.event.inputs.release_name }}
body: |
Antares_Simulator : ${{ github.event.inputs.antares_tag }}
Antares_Simulator_Tests_NR : ${{ github.event.inputs.antares_tests_tag }}
matrix:
runs-on: ubuntu-latest
needs: release
outputs:
batches: ${{ steps.read_batches.outputs.batches }}
steps:
- name: Download study-batches.txt
run: |
wget https://github.com/AntaresSimulatorTeam/Antares_Simulator_Tests_NR/releases/download/${{ github.event.inputs.antares_tests_tag }}/study-batches.txt
- name: Read study-batches.txt
id: read_batches
run: |
BATCHES=$(printf "\"%s\"," $(cat study-batches.txt) | sed "s/^/[/;s/,$/]/")
echo "::set-output name=batches::$BATCHES"
- name: Upload study-batches.txt
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.release.outputs.url }}
asset_path: study-batches.txt
asset_name: study-batches.txt
asset_content_type: application/octet-stream
generation:
runs-on: ${{ matrix.os }}
needs: [release, matrix]
strategy:
fail-fast: false
matrix:
batch: ${{ fromJson(needs.matrix.outputs.batches) }}
os: [ubuntu-20.04, windows-2022]
steps:
- name: Checkout SimTest
uses: actions/checkout@v2
- name: Pre-requisites (Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
run: choco install wget zip unzip --no-progress
- name: Download Antares_Simulator archive (Ubuntu)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
ANTARES_TAG=${{ github.event.inputs.antares_tag }}
wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/${{ github.event.inputs.antares_tag }}/antares-${ANTARES_TAG/v/}-Ubuntu-20.04.tar.gz -O antares_simulator.tar.gz
- name: Download Antares_Simulator archive (Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
run: |
ANTARES_TAG=${{ github.event.inputs.antares_tag }}
wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/${{ github.event.inputs.antares_tag }}/rte-antares-${ANTARES_TAG/v/}-installer-64bits.zip -O antares_simulator.zip
shell: bash
- name: Unpack Antares_Simulator, clean archive (Ubuntu)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
tar xf antares_simulator.tar.gz
rm antares_simulator.tar.gz
- name: Unpack Antares_Simulator, clean archive (Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
run: |
unzip -q antares_simulator.zip
rm antares_simulator.zip
- name: Download Antares_Simulator_Tests
run: wget https://github.com/AntaresSimulatorTeam/Antares_Simulator_Tests_NR/releases/download/${{ github.event.inputs.antares_tests_tag }}/${{ matrix.batch }}.zip -O input.zip
- name: Unpack test studies, clean archive
run: |
unzip -q input.zip
rm input.zip
- name: Generate results (Ubuntu)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
ANTARES_TAG=${{ github.event.inputs.antares_tag }}
python3 scripts/generate_reference.py ${{ matrix.batch }} antares-${ANTARES_TAG/v/}-Ubuntu-20.04/bin
- name: Generate results (Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
run: |
ANTARES_TAG=${{ github.event.inputs.antares_tag }}
python3 scripts/generate_reference.py ${{ matrix.batch }} rte-antares-${ANTARES_TAG/v/}-installer-64bits/bin
shell: bash
- name: Write tags to file
shell: bash
run: |
echo Antares_Simulator ${{ github.event.inputs.antares_tag }} >> ${{ matrix.batch }}/version.txt
echo Antares_Simulator_Tests_NR ${{ github.event.inputs.antares_tests_tag }} >> ${{ matrix.batch }}/version.txt
echo SimTest ${{ github.event.inputs.release_tag }} >> ${{ matrix.batch }}/version.txt
- name: zip results
run: zip -q -r results.zip ${{ matrix.batch }}
- name: Upload .zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.release.outputs.url }}
asset_path: results.zip
asset_name: ${{ matrix.batch }}-${{ matrix.os }}.zip
asset_content_type: application/octet-stream