-
Notifications
You must be signed in to change notification settings - Fork 6
159 lines (149 loc) · 5 KB
/
seal5_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
##
## Copyright (c) 2024 TUM Department of Electrical and Computer Engineering.
##
## This file is part of Seal5.
## See https://github.com/tum-ei-eda/seal5.git for further info.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
# Seal5 demonstration (also serves as end-to-end testj
name: Usage Seal5-Build
on:
repository_dispatch:
types: [s4e-cdsl-event]
workflow_dispatch:
inputs:
# script:
# description: "Script"
# required: true
# default: "s4e_demo.py"
verbose:
description: "Verbose (0/1)"
required: true
default: "0"
progress:
description: "Enable progress bars (0/1)"
required: true
default: "1"
clone_depth:
description: "Clone Depth (-1 for full clone)"
required: true
default: "1"
ignore_error:
description: "Ignore Errors in TEST stage (0/1)"
required: true
default: "1"
build_config:
description: "Build Config (debug/release/...)"
required: true
default: "release_assertions"
test:
description: "Run LLVM tests"
required: true
default: "1"
install:
description: "Install LLVM (and upload as artifact)"
required: true
default: "1"
deploy:
description: "Install LLVM Sources (and upload as artifact)"
required: true
default: "1"
export:
description: "Install Seal5 Artifacts (and upload as artifact)"
required: true
default: "1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
build_seal5:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10"]
os: ["ubuntu-latest"]
ccache: ["1"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup ccache
if: ${{ matrix.ccache == '1' }}
uses: hendrikmuhs/ccache-action@v1
with:
max-size: 2G
key: ${{ matrix.os }}-s4e_demo.py-${{ github.event.inputs.build_config }}
variant: sccache
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install APT packages
run: |
sudo apt -qq install -y python3-pip python3-venv cmake make ninja-build
- name: Initialize Virtualenv
run: |
python -m pip install --upgrade pip
python -m venv .venv
- name: Install dependencies
run: |
source .venv/bin/activate
pip install -r requirements.txt
pip list
- name: Setup Build Environment
run: |
source .venv/bin/activate
pip install -e .
- name: Run the demo
run: |
source .venv/bin/activate
VERBOSE=0 PROGESS=1 CLONE_DEPTH=1 CCACHE=${{ matrix.ccache }} BUILD_CONFIG=release IGNORE_ERROR=1 TEST=1 INSTALL=1 DEPLOY=1 EXPORT=1 DEST=/tmp/seal5_llvm python3 examples/s4e_demo.py
- uses: actions/upload-artifact@v4
if: "${{ github.event.inputs.export == '1' || github.event_name == 'repository_dispatch' }}"
with:
name: demo-export
path: /tmp/seal5_llvm.tar.gz
- uses: actions/upload-artifact@v4
if: "${{ github.event.inputs.install == '1' || github.event_name == 'repository_dispatch' }}"
with:
name: demo-install
path: /tmp/seal5_llvm/.seal5/install/${{ github.event.inputs.build_config }}
trigger_etiss_example_build:
runs-on: ubuntu-latest
needs: build_seal5
steps:
- name: Download ETISS RUN-ID Artifacts
id: download-artifact
uses: dawidd6/action-download-artifact@v6
with:
name: etiss-run-id
github_token: ${{ secrets.SEAL5_ACCESS_TOKEN }}
repo: tum-ei-eda/seal5
path: /home/runner/work/
workflow: sync_etiss_seal5_build.yml
workflow_conclusion: success
- name: Set ETISS RUN-ID as Variable
shell: bash
run: |
ETISS_RUN_ID=$(cat /home/runner/work/etiss-run-id.txt)
echo "ETISS_RUN_ID=$ETISS_RUN_ID" >> $GITHUB_ENV
echo ${{ env.ETISS_RUN_ID }}
echo $ETISS_RUN_ID
- name: Trigger ETISS-RISCV-EXAMPLE Build
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.SEAL5_ACCESS_TOKEN }}
repository: tum-ei-eda/etiss_riscv_examples_s4e
event-type: seal5-event
client-payload: '{"triggered_run_id": "${{ github.run_id }}", "etiss_run_id": "${{ env.ETISS_RUN_ID }}"}'