-
Notifications
You must be signed in to change notification settings - Fork 44
80 lines (77 loc) · 2.4 KB
/
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
name: Build Skybolt
on:
workflow_call:
inputs:
os:
default: ubuntu-22.04
type: string
python-version:
default: "3.11.x"
type: string
python-arch:
default: "x64"
type: string
build_docs:
description: Build the documentation?
type: boolean
default: true
upload:
description: Upload resulting artifact?
type: boolean
default: false
run-name: Build for ${{ inputs.os }}
permissions:
contents: read
jobs:
build:
runs-on: ${{ inputs.os }}
env:
packageDir: ${{github.workspace}}/package
steps:
- uses: actions/[email protected]
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ inputs.python-version }}
architecture: ${{ inputs.python-arch }}
- name: Install C and C++ header files
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt-get install -y gcc-multilib g++-multilib
- name: Install required python packages
run: |
python3 -m pip install --upgrade pip
pip3 install -r ${{github.workspace}}/Tools/BuildScripts/requirements.txt
- name: Configure conan (Linux)
if: runner.os == 'Linux'
run: |
conan profile detect
echo "compiler.cppstd=17" >> ~/.conan2/profiles/default # Set cppstd to 17
export CONAN_SYSREQUIRES_MODE=enabled
- name: Configure conan (Windows)
if: runner.os == 'Windows'
run: |
conan profile detect
- name: Build
run: |
python3 ${{github.workspace}}/Tools/BuildScripts/build.py ${{github.workspace}} ${{env.packageDir}} --stage package
- name: Build docs
if: inputs.build_docs
run: |
python3 ${{github.workspace}}/Tools/BuildScripts/build.py ${{github.workspace}} ${{env.packageDir}} --stage package_docs --only
- name: Cmake test
run: |
cd ${{env.packageDir}}/Build
ctest
- name: Zip Build Artifact
if: inputs.upload
working-directory: ${{env.packageDir}}/Package
run: |
7z a "${{ github.workspace }}/out/Skybolt.zip" .
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
if: inputs.upload
with:
name: Skybolt-${{ inputs.os }}
path: ${{ github.workspace }}/out/Skybolt.zip # The file to upload
retention-days: 1