-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (166 loc) · 5.28 KB
/
ci_cd.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: CI
on:
pull_request:
push:
tags:
- "*"
branches:
- main
workflow_dispatch:
env:
MAIN_PYTHON_VERSION: '3.10'
DOCUMENTATION_CNAME: 'smart-boiler-control.examples.scade.docs.pyansys.com'
LIBRARY_NAME: 'ansys-scade-examples-smart-boiler-control'
ARTIFACT_NAME: 'SmartBoilerStandaloneExecutable'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-style:
name: "Code style"
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/code-style@v8
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false
doc-style:
name: "Documentation style"
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/doc-style@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
doc-build:
name: "Build documentation"
runs-on: ubuntu-latest
timeout-minutes: 30
needs: doc-style
steps:
- uses: ansys/actions/doc-build@v8
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
skip-install: true
use-python-cache: false
dependencies: "texlive-fonts-extra qpdf"
check-links: false
standalone-display:
name: "Standalone Display"
runs-on: [self-hosted, 'SCADE']
strategy:
matrix:
os: [windows-latest]
scade-version: ['24.1']
fail-fast: false
needs: [code-style]
steps:
- name: "Install Git and clone project"
uses: actions/checkout@v4
- name: "Get SCADE installation directory"
uses: ansys/scade-actions/get-scade-dir@v2
id: get-scade-dir
with:
scade-version: "24.1"
- name: "Generate Standalone"
uses: ansys/scade-actions/display-generate@v2
with:
scade-dir: ${{ steps.get-scade-dir.outputs.scade-directory }}
project: 'model/scade-display/DisplayPanel.etp'
configuration: 'Windows'
- name: "Upload folder to artifacts"
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ./model/scade-display/DisplayPanel_Exe
retention-days: 7
if-no-files-found: error
scade-test-display:
name: "Run Test Execution"
runs-on: [self-hosted, 'SCADE']
needs: [code-style]
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: "Get SCADE installation directory"
uses: ansys/scade-actions/get-scade-dir@v2
id: get-scade-dir
with:
scade-version: "24.1"
- name: "Execute tests"
uses: ansys/scade-actions/test-execute@v2
with:
scade-dir: ${{ steps.get-scade-dir.outputs.scade-directory }}
test-project: 'model/scade-test/SmartBoilerControl_Test.etp'
configuration: 'Test'
results-project: 'model/scade-test/SmartBoilerControl_Results.etp'
checkout: false
release:
name: "Release project"
runs-on: ubuntu-latest
needs: [standalone-display, scade-test-display, doc-build]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
steps:
- name: "Download HTML documentation"
uses: actions/download-artifact@v4
with:
name: documentation-html
path: documentation-html
- name: "Zip HTML documentation"
uses: vimtor/[email protected]
with:
files: documentation-html
dest: documentation-html.zip
- name: "Download PDF documentation"
uses: actions/download-artifact@v4
with:
name: documentation-pdf
path: documentation-pdf
- name: "Zip PDF documentation"
uses: vimtor/[email protected]
with:
files: documentation-pdf
dest: documentation-pdf.zip
- name: "Download Standalone"
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_NAME }}
- name: "Zip Standalone"
uses: vimtor/[email protected]
with:
files: ${{ env.ARTIFACT_NAME }}
dest: ${{ env.ARTIFACT_NAME }}.zip
- name: "Display the structure of downloaded files"
shell: bash
run: ls -R
- name: "Release to GitHub"
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
documentation-html.zip
documentation-pdf.zip
${{ env.ARTIFACT_NAME }}.zip
doc-deploy-dev:
name: "Deploy development documentation"
# Deploy development only when merging or pushing to the 'main' branch
runs-on: ubuntu-latest
needs: [standalone-display, scade-test-display, doc-build]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: ansys/actions/doc-deploy-dev@v8
with:
doc-artifact-name: 'documentation-html'
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-deploy-stable:
name: "Deploy stable documentation"
# Deploy release documentation when creating a new tag
runs-on: ubuntu-latest
needs: [release]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
steps:
- uses: ansys/actions/doc-deploy-stable@v8
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}