-
Notifications
You must be signed in to change notification settings - Fork 33
154 lines (129 loc) · 5.45 KB
/
ci.yml
File metadata and controls
154 lines (129 loc) · 5.45 KB
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
name: CMake Build
on:
pull_request:
types: [opened, synchronize]
branches: main-ge
schedule:
# Run workflow night at 5 AM UTC (10PM PST)
- cron: '0 5 * * *'
workflow_dispatch:
# see binary-caching-github-actions-cache
env:
VCPKG_BINARY_SOURCES: "clear;nuget,https://pkgs.dev.azure.com/vcpkg/public/_packaging/public/nuget/v3/index.json,readwrite"
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout AIEBU
uses: actions/checkout@v4
with:
submodules: recursive
# See binary caching with github actions
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Dependencies (Linux) and configure CMake
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libelf-dev libboost-dev pylint elfutils
python -m pip install --upgrade pip
pip install pyyaml jinja2 Markdown pylint colorama gitPython wrapt
cmake -B ${{github.workspace}}/build/Release \
-DCMAKE_BUILD_TYPE=Release -DAIEBU_PYTHON=ON
- name: Save Python Path for ise with CMake
if: runner.os == 'Windows'
run: |
$python_path = (Get-Command python3).path
echo "PYTHON_EXECUTABLE=$python_path"
echo "PYTHON_EXECUTABLE=$python_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache vcpkg packages
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: |
C:\vcpkg\installed
C:\vcpkg\buildtrees
C:\vcpkg\downloads
key: vcpkg-${{ runner.os }}-${{ matrix.os }}-${{ hashFiles('**/vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-${{ matrix.os }}-
vcpkg-${{ runner.os }}-
- name: Install Dependencies (Windows) and configure CMake
if: runner.os == 'Windows'
run: |
$isArm64 = "${{ matrix.os }}" -eq "windows-11-arm"
$triplet = if ($isArm64) { 'arm64-windows' } else { 'x64-windows' }
vcpkg install --triplet=$triplet
# install python dependencies
python -m pip install --upgrade pip
python -m pip install pyyaml jinja2 Markdown pylint colorama gitPython wrapt
# configure cmake specifying path to python
$cmakeArgs = @(
"-B", "${{github.workspace}}/build/WBuild",
"-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake",
"-DCMAKE_BUILD_TYPE=Release",
"-DPython3_EXECUTABLE=${{ env.PYTHON_EXECUTABLE }}",
"-DAIEBU_PYTHON=ON"
)
if ($isArm64) {
$cmakeArgs += "-A", "ARM64", "-DCMAKE_SYSTEM_PROCESSOR=ARM64"
}
cmake @cmakeArgs
- name: Build (Linux)
if: runner.os == 'Linux'
run: |
cmake --build ${{github.workspace}}/build/Release --config Release -j 4
- name: Build (Windows)
if: runner.os == 'Windows'
run: |
cmake --build ${{github.workspace}}/build/WBuild --config Release -j 4
- name: Install (Linux)
if: runner.os == 'Linux'
run: |
# Specify staging install area specific to Linux.
# Binary dir (Release) is specific to configuration.
# The unittest cmake_test test requires opt/xilinx/aiebu staging area
cmake --install ${{github.workspace}}/build/Release --config Release --prefix ${{github.workspace}}/build/Release/opt/xilinx/aiebu
- name: Install (Windows)
if: runner.os == 'Windows'
run: |
# Specify staging install area specific to Windows.
# Multi-config build setup, binary dir (WBuild) is shared.
# The unittest cmake_test test requires Release/xilinx/aiebu staging area
cmake --install ${{github.workspace}}/build/WBuild --config Release --prefix ${{github.workspace}}/build/WBuild/Release/xilinx/aiebu
- name: Test (Linux)
if: runner.os == 'Linux'
run: |
ctest --test-dir ${{github.workspace}}/build/Release -C Release -j 4
- name: Test (Windows)
if: runner.os == 'Windows'
run: |
ctest --test-dir ${{github.workspace}}/build/WBuild -C Release -j 4
- name: Package (Linux)
if: runner.os == 'Linux'
run: |
cpack -G TGZ -B ${{github.workspace}}/build/Release -C Release --config ${{github.workspace}}/build/Release/CPackConfig.cmake
- name: Package (Windows)
if: runner.os == 'Windows'
run: |
cpack -G ZIP -B ${{github.workspace}}/build/WBuild -C Release --config ${{github.workspace}}/build/WBuild/CPackConfig.cmake
- name: Upload (Linux)
if: runner.os == 'Linux' && (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
uses: actions/upload-artifact@v4
with:
name: aiebu_release_${{ matrix.os }}
path: ${{github.workspace}}/build/Release/AIEBU-*-Linux.tar.gz
- name: Upload (Windows)
if: runner.os == 'Windows' && (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
uses: actions/upload-artifact@v4
with:
name: aiebu_release_${{ matrix.os }}
path: ${{github.workspace}}/build/WBuild/AIEBU-*-win64.zip
retention-days: 7