-
Notifications
You must be signed in to change notification settings - Fork 10
114 lines (92 loc) · 3.75 KB
/
ci.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
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;x-gha,readwrite"
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
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 \
-DAIEBU_FULL=ON \
-DCMAKE_BUILD_TYPE=Release
- 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: Install Dependencies (Windows) and configure CMake
if: runner.os == 'Windows'
run: |
vcpkg integrate install
vcpkg install boost-format boost-uuid boost-interprocess boost-algorithm boost-property-tree boost-headers --triplet=x64-windows
# 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
cmake -B ${{github.workspace}}/build/Release `
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DAIEBU_FULL=ON `
-DCMAKE_BUILD_TYPE=Release `
-DPython3_EXECUTABLE=${{ env.PYTHON_EXECUTABLE }}
- name: Build
run: |
cmake --build ${{github.workspace}}/build/Release --config Release --target install
- name: Test (Linux)
if: runner.os == 'Linux'
run: |
cmake --build ${{github.workspace}}/build/Release --config Release --target test
- name: Test (Windows)
if: runner.os == 'Windows'
run: |
cmake --build ${{github.workspace}}/build/Release --config Release --target run_tests
- name: Package (Linux)
if: runner.os == 'Linux'
run: |
cpack -G TGZ -B ${{github.workspace}}/build/Release -C Release --config build/Release/CPackConfig.cmake
- name: Package (Windows)
if: runner.os == 'Windows'
run: |
cpack -G ZIP -B ${{github.workspace}}/build/Release -C Release --config build/Release/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_linux
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_windows
path: ${{github.workspace}}/build/Release/AIEBU-*-win64.zip
retention-days: 7