-
-
Notifications
You must be signed in to change notification settings - Fork 731
174 lines (155 loc) · 6.34 KB
/
pixi.yml
File metadata and controls
174 lines (155 loc) · 6.34 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: ITK.Pixi
on:
push:
branches:
- main
- 'release*'
paths-ignore:
- '*.md'
- LICENSE
- NOTICE
- 'Documentation/**'
- 'Utilities/Debugger/**'
- 'Utilities/ITKv5Preparation/**'
- 'Utilities/Maintenance/**'
- 'Modules/Remote/*.remote.cmake'
pull_request:
paths-ignore:
- '*.md'
- LICENSE
- NOTICE
- 'Documentation/**'
- 'Utilities/Debugger/**'
- 'Utilities/ITKv5Preparation/**'
- 'Utilities/Maintenance/**'
- 'Modules/Remote/*.remote.cmake'
concurrency:
group: '${{ github.workflow }}@${{ github.head_ref || github.ref }}'
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
ExternalDataVersion: 5.4.5
jobs:
Pixi-Cxx:
runs-on: ${{ matrix.os }}
timeout-minutes: 0
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-15]
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 5
clean: true
- name: Install ccache
shell: bash
run: |
echo "CCACHE_BASEDIR=${GITHUB_WORKSPACE}" >> "$GITHUB_ENV"
echo "CCACHE_COMPILERCHECK=content" >> "$GITHUB_ENV"
echo "CCACHE_NOHASHDIR=true" >> "$GITHUB_ENV"
echo "CCACHE_SLOPPINESS=pch_defines,time_macros" >> "$GITHUB_ENV"
echo "CCACHE_DIR=${{ runner.temp }}/ccache" >> "$GITHUB_ENV"
echo "CCACHE_MAXSIZE=5G" >> "$GITHUB_ENV"
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update -qq && sudo apt-get install -y ccache locales
sudo locale-gen de_DE.UTF-8
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install ccache
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install ccache --yes
fi
- name: Restore compiler cache
id: restore-ccache
uses: actions/cache/restore@v5
with:
path: ${{ runner.temp }}/ccache
key: ccache-v4-${{ runner.os }}-pixi-cxx-${{ github.sha }}
restore-keys: |
ccache-v4-${{ runner.os }}-pixi-cxx-
- name: Show ccache configuration, stats and maintenance
shell: bash
run: |
ccache --zero-stats
ccache --evict-older-than 7d
ccache --show-config
- name: Disk space reporting BEFORE (optimize free-disk-space)
run: |
echo "****** df -h ${{ runner.temp }}"
df -h "${{ runner.temp }}"
echo "****** df -h"
df -h
echo "****** df -hi /"
df -h /
- name: Free Disk Space (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
uses: BRAINSia/free-disk-space@v2
with:
removalmode: "rmz"
swap-storage: "true"
haskell: "true"
dotnet: "true"
docker-images: "false" # Takes too long
tool-cache: "true"
android: "false" # Takes too long
large-packages: "true" # Takes too long to remove apt-get packages
mandb: "true" # Speeds up future apt-get installs (disables man page generation), this CI does not use apt-get
# For ITK run with find
# TIME_REPORT: =============================================================
# TIME_REPORT: swap-storage | 0 seconds | 4.0GiB |
# TIME_REPORT: haskell | 10 seconds | 6.2GiB |
# TIME_REPORT: dotnet | 27 seconds | 3.3GiB |
# TIME_REPORT: docker-images | 81 seconds | 3.4GiB |
# TIME_REPORT: tool-cache | 113 seconds | 5.3GiB |
# TIME_REPORT: android | 295 seconds | 8.8GiB |
# TIME_REPORT: root | 526 seconds | 27GiB |
# TIME_REPORT: overall | 526 seconds | 31GiB |
# TIME_REPORT: == find ====================================================
- name: Download testing data
run: |
curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v${{ env.ExternalDataVersion }}/InsightData-${{ env.ExternalDataVersion }}.tar.gz -O
cmake -E tar xfz InsightData-${{ env.ExternalDataVersion }}.tar.gz
cmake -E rename InsightToolkit-${{ env.ExternalDataVersion }}/.ExternalData/CID ${{ github.workspace }}/.ExternalData/CID
- name: Set up Pixi
uses: prefix-dev/setup-pixi@v0.8.1
- name: Configure
run: pixi run configure-ci
- name: Build
run: |
echo "****** df -h / -- pre build"
df -h /
pixi run --skip-deps build
echo "****** df -h / -- post build"
df -h /
- name: Free disk space after build
shell: bash
run: |
# Remove object files and static libraries (not needed for testing)
find build -type f -name "*.o" -delete
find build -type f -name "*.a" -delete
# Remove downloaded data tarballs (already extracted)
rm -f InsightData-*.tar.gz
# Remove extracted source tarball directory
rm -rf InsightToolkit-${{ env.ExternalDataVersion }}
# Trim ccache to stay within CCACHE_MAXSIZE and remove orphaned entries
ccache --cleanup 2>/dev/null || true
echo "****** df -h / -- post cleanup"
df -h /
- name: Test
run: pixi run --skip-deps test
- name: Disk space reporting AFTER (optimize free-disk-space)
run: |
echo "****** df -h ${{ runner.temp }}"
df -h "${{ runner.temp }}"
echo "****** df -h"
df -h
echo "****** df -h /"
df -h /
- name: Save compiler cache
if: ${{ !cancelled() }}
uses: actions/cache/save@v5
with:
path: ${{ runner.temp }}/ccache
key: ccache-v4-${{ runner.os }}-pixi-cxx-${{ github.sha }}
- name: ccache stats
if: always()
run: ccache --show-stats