-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (140 loc) · 5.57 KB
/
Copy pathbuild-cache.yml
File metadata and controls
178 lines (140 loc) · 5.57 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
175
176
177
178
name: Build precompiled cache (Processing.o + PCH)
on:
workflow_dispatch:
push:
paths:
- 'src/Processing.cpp'
- 'src/Processing.h'
- 'src/Processing_defaults.cpp'
permissions:
contents: write
jobs:
linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install gcc-14
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -q
sudo apt-get install -y gcc-14 g++-14 libglfw3-dev libglew-dev
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
- name: Build cache
run: |
mkdir -p cache/linux-x64
CFLAGS="-std=c++2c -O2 -march=x86-64"
LFLAGS="-static-libgcc -static-libstdc++"
DEFS="-DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE"
INC="-I src"
echo "Building Processing.h.gch..."
g++ $CFLAGS $DEFS $INC -x c++-header src/Processing.h -o cache/linux-x64/Processing.h.gch
echo "Building Processing.o..."
g++ $CFLAGS $LFLAGS $DEFS $INC -c src/Processing.cpp -o cache/linux-x64/Processing.o
echo "Building Processing_defaults.o..."
g++ $CFLAGS $LFLAGS $DEFS $INC -c src/Processing_defaults.cpp -o cache/linux-x64/Processing_defaults.o
echo "Done:"
ls -lh cache/linux-x64/
- uses: actions/upload-artifact@v4
with:
name: cache-linux-x64
path: cache/linux-x64/
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install MinGW
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-glfw mingw-w64-x86_64-glew
- name: Build cache
shell: msys2 {0}
run: |
mkdir -p cache/windows-x64
CFLAGS="-std=c++2c -O2 -march=x86-64"
LFLAGS="-static-libgcc -static-libstdc++"
DEFS="-DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE"
INC="-I src"
echo "Building Processing.h.gch..."
g++ $CFLAGS $DEFS $INC -x c++-header src/Processing.h -o cache/windows-x64/Processing.h.gch
echo "Building Processing.o..."
g++ $CFLAGS $LFLAGS $DEFS $INC -c src/Processing.cpp -o cache/windows-x64/Processing.o
echo "Building Processing_defaults.o..."
g++ $CFLAGS $LFLAGS $DEFS $INC -c src/Processing_defaults.cpp -o cache/windows-x64/Processing_defaults.o
ls -lh cache/windows-x64/
- uses: actions/upload-artifact@v4
with:
name: cache-windows-x64
path: cache/windows-x64/
macos-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
export HOMEBREW_NO_REQUIRE_TAP_TRUST=1
brew install glfw glew
- name: Build cache
run: |
mkdir -p cache/macos-arm64
BREW=$(brew --prefix)
FLAGS="-std=c++2c -O2 -w -DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE -I src -I $BREW/include"
echo "Building Processing.o..."
g++ $FLAGS -Wno-error -c src/Processing.cpp -o cache/macos-arm64/Processing.o || echo "WARNING: Processing.o build failed, skipping"
echo "Building Processing_defaults.o..."
g++ $FLAGS -Wno-error -c src/Processing_defaults.cpp -o cache/macos-arm64/Processing_defaults.o || echo "WARNING: defaults.o build failed, skipping"
ls -lh cache/macos-arm64/
- uses: actions/upload-artifact@v4
with:
name: cache-macos-arm64
path: cache/macos-arm64/
macos-x64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
export HOMEBREW_NO_REQUIRE_TAP_TRUST=1
brew install glfw glew
- name: Build cache
run: |
mkdir -p cache/macos-x64
BREW=$(brew --prefix)
FLAGS="-std=c++2c -O2 -w -target x86_64-apple-macos10.13 -DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE -I src -I $BREW/include"
echo "Building Processing.o..."
g++ $FLAGS -Wno-error -c src/Processing.cpp -o cache/macos-x64/Processing.o || echo "WARNING: Processing.o build failed, skipping"
echo "Building Processing_defaults.o..."
g++ $FLAGS -Wno-error -c src/Processing_defaults.cpp -o cache/macos-x64/Processing_defaults.o || echo "WARNING: defaults.o build failed, skipping"
ls -lh cache/macos-x64/
- uses: actions/upload-artifact@v4
with:
name: cache-macos-x64
path: cache/macos-x64/
commit:
needs: [linux, windows, macos-arm64, macos-x64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cache-linux-x64
path: cache/linux-x64/
- uses: actions/download-artifact@v4
with:
name: cache-windows-x64
path: cache/windows-x64/
- uses: actions/download-artifact@v4
with:
name: cache-macos-arm64
path: cache/macos-arm64/
- uses: actions/download-artifact@v4
with:
name: cache-macos-x64
path: cache/macos-x64/
- name: Commit cache files
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -f cache/
git diff --staged --quiet || git commit -m "ci: update precompiled cache (Processing.o + PCH) for all platforms"
git push