-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (46 loc) · 1.28 KB
/
build.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
name: Build
on:
pull_request:
push:
branches:
- main
jobs:
build:
name: Generate code
runs-on: ubuntu-latest
strategy:
matrix:
language:
- java
- javascript
- python
- modernpython
- cpp
schema:
- CGMES_2.4.15_27JAN2020
- CGMES_3.0.0
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Generate code
run: |
python -m venv venv
. venv/bin/activate
pip install .
# Extract version (2.4.15 => 2_4_15), ignore the date part
SCHEMA_VERSION=$(echo "${{matrix.schema}}" | cut -d'_' -f2 | cut -d'.' -f1-3 | tr '.' '_')
# Run cimgen with the valid version
cimgen \
--outdir=output/${{matrix.language}}/${{matrix.schema}} \
--schemadir=cgmes_schema/${{matrix.schema}} \
--langdir=${{matrix.language}} \
--cgmes_version=cgmes_v${SCHEMA_VERSION}
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: ${{matrix.schema}}-${{matrix.language}}
path: output/${{matrix.language}}