-
Notifications
You must be signed in to change notification settings - Fork 36
147 lines (143 loc) · 4.58 KB
/
build-ultralite.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
# Build directly on the GitHub runner with caching
name: build-ultralite
on:
workflow_dispatch:
workflow_call:
concurrency:
group: build-ultralite-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}}
cancel-in-progress: true
# env:
# CCACHE_DEBUG: 1
# CCACHE_DEBUGDIR: ${{github.workspace}}/ccache-debug
jobs:
linux:
name: ultralite-ubuntu
env:
CCACHE_DIR: "${{github.workspace}}/.ccache"
CCACHE_MAXSIZE: "50Mi"
CMAKE_PRESET: ultralite
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get -q -y update
sudo apt-get -q -y install \
ccache cmake ninja-build
- name: Check out Celeritas
uses: actions/checkout@v4
- name: Cache ccache
uses: actions/cache@v4
with:
path: ${{env.CCACHE_DIR}}
key: ccache-ultralite-ubuntu-${{github.run_id}}
restore-keys: |
ccache-ultralite
- name: Zero ccache stats
run: |
ccache -z
- name: Configure Celeritas
run: |
ln -fs scripts/cmake-presets/ci-ubuntu-github.json CMakeUserPresets.json
cmake --preset=${CMAKE_PRESET} \
-DCeleritas_GIT_DESCRIBE="${{github.event.pull_request
&& format(';-pr.{0};', github.event.pull_request.number)
|| format(';-{0};', github.ref_name)}}"
- name: Build
working-directory: build
run: |
ninja
- name: Run tests
id: test
working-directory: build
run: |
ctest --parallel $(nproc) --timeout 15 --output-on-failure \
--output-junit test-results.junit.xml
- name: Install
working-directory: build
run: |
ninja install
- name: Check installation
working-directory: install
run: |
./bin/celer-sim --version
- name: Show ccache stats
if: ${{!cancelled()}}
run: |
ccache -s
- name: Upload ccache debug
if: ${{env.CCACHE_DEBUG && !cancelled()}}
uses: actions/upload-artifact@v4
with:
path: ${{env.CCACHE_DEBUGDIR}}
name: ccache-debug-${{github.job}}
overwrite: true
retention-days: 7
- name: Upload test results
uses: actions/upload-artifact@v4
if: ${{steps.test.outcome == 'success'
|| steps.test.outcome == 'failure')}}
name: test-results-ultralite-ubuntu
path: "build/test-results.junit.xml"
if-no-files-found: error
retention-days: 1
windows:
name: ultralite-windows
env:
CCACHE_DIR: "${{github.workspace}}\\.ccache"
CCACHE_MAXSIZE: "50Mi"
CMAKE_PRESET: ultralite
runs-on: windows-latest
steps:
- name: Install dependencies
run: |
choco install ninja ccache
- name: Check out Celeritas
uses: actions/checkout@v4
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Cache ccache
uses: actions/cache@v4
with:
path: ${{env.CCACHE_DIR}}
key: ccache-ultralite-windows-${{github.run_id}}
restore-keys: |
ccache-ultralite
- name: Zero ccache stats
run: |
ccache -z
- name: Configure Celeritas
shell: pwsh
run: |
Copy-Item scripts/cmake-presets/ci-windows-github.json -Destination CMakeUserPresets.json
cmake --preset=$Env:CMAKE_PRESET `
-DCeleritas_GIT_DESCRIBE="${{github.event.pull_request
&& format(';-pr.{0};', github.event.pull_request.number)
|| format(';-{0};', github.ref_name)}}"
- name: Build all
run: |
cmake --build --preset=$Env:CMAKE_PRESET
- name: Test all
continue-on-error: true
run: |
ctest --preset=$Env:CMAKE_PRESET \
--output-junit test-results.junit.xml
- name: Show ccache stats
if: ${{!cancelled()}}
run: |
ccache -s
- name: Upload ccache debug
if: ${{env.CCACHE_DEBUG && !cancelled()}}
uses: actions/upload-artifact@v4
with:
path: ${{env.CCACHE_DEBUGDIR}}
name: ccache-debug-${{github.job}}
overwrite: true
retention-days: 7
- name: Upload test results
uses: actions/upload-artifact@v4
if: ${{!cancelled()}}
name: test-results-ultralite-windows
path: "build/test-results.junit.xml"
if-no-files-found: error
retention-days: 1
# vim: set nowrap tw=100: