Debian Codegraph @

.github/workflows/main.yml

raw symbols SCIP
1 name: CI
2 on:
3 push:
4 branches: [ master, releases/** ]
5 pull_request:
6 branches: [ master ]
7 workflow_dispatch:
8
9 jobs:
10 linux:
11 runs-on: ${{ matrix.os }}
12 strategy:
13 matrix:
14 os: ["ubuntu-latest"]
15 target: ["NoUI", "Debug"]
16 include:
17 - os: ubuntu-22.04
18 target: Release
19 steps:
20 - uses: actions/checkout@v6
21 with:
22 path: repo
23 - uses: actions/setup-java@v5
24 with:
25 distribution: 'temurin'
26 java-version: '17'
27 - name: Restore cached custom dependencies
28 id: cache-dependencies
29 uses: actions/cache@v5
30 with:
31 path: deps/install
32 key: ${{ matrix.os }}-deps-${{ hashFiles('repo/.github/workflows/scripts/setup_linux_deps.sh') }}
33 - name: Install dependencies and setup env vars
34 run: ${{ github.workspace }}/repo/.github/workflows/scripts/setup_linux_deps.sh
35 - name: Build FontForge
36 working-directory: repo
37 run: |
38 FFCONFIG="-DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_FONTFORGE_EXTRAS=ON -DENABLE_FREETYPE_DEBUGGER=$DEPSPREFIX/freetype"
39 if [ "${{ matrix.target }}" == "Debug" ]; then
40 FFCONFIG="$FFCONFIG -DENABLE_CODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_DOCS=ON -DSPHINX_USE_VENV=ON"
41 elif [ "${{ matrix.target }}" == "NoUI" ]; then
42 FFCONFIG="$FFCONFIG -DENABLE_GUI=OFF -DENABLE_PYTHON_SCRIPTING=OFF"
43 fi
44 mkdir build && pushd build && cmake -GNinja $FFCONFIG .. && popd
45 if [ "${{ matrix.target }}" == "NoUI" ]; then
46 ninja -C build all install
47 else
48 ninja -C build all potfiles install
49 fi
50 - name: Run FontForge tests
51 run: CTEST_PARALLEL_LEVEL=100 ninja -C repo/build check
52 - name: Build dist bundle
53 if: matrix.target == 'NoUI'
54 run: ninja -C repo/build dist
55 - name: Run pyhook smoke test
56 if: matrix.target != 'NoUI'
57 working-directory: repo
58 run: |
59 # There can be several Python versions installed. We must use the exact one discovered by CMake.
60 PYTHON=`grep -m1 'Python3_EXECUTABLE.*=' build/CMakeCache.txt | cut -d= -f2`
61 $PYTHON tests/pyhook_smoketest.py
62 - name: Build AppImage
63 if: matrix.target == 'Release'
64 working-directory: repo/build
65 run: |
66 DESTDIR=appdir cmake -DCMAKE_INSTALL_PREFIX=/usr -P cmake_install.cmake
67 ../.github/workflows/scripts/ffappimagebuild.sh appdir $GITHUB_SHA
68 - name: Source archive artifact
69 uses: actions/upload-artifact@v7
70 if: matrix.target == 'NoUI'
71 with:
72 name: source-archive
73 path: repo/build/fontforge-*.tar.xz
74 - name: AppImage artifact
75 uses: actions/upload-artifact@v7
76 if: matrix.target == 'Release'
77 with:
78 name: Linux_appimage
79 path: repo/build/FontForge-*-x86_64.AppImage
80 - name: Update Potfile for Crowdin
81 if: matrix.target == 'Release' && github.ref == 'refs/heads/master' && github.repository == 'fontforge/fontforge' && github.event_name == 'push'
82 working-directory: repo
83 env:
84 CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
85 run: java -jar $DEPSPREFIX/crowdin-cli.jar upload -c .crowdin.yml
86
87 mac:
88 runs-on: ${{ matrix.runner }}
89 strategy:
90 matrix:
91 include:
92 - runner: macos-14
93 arch: arm64
94 - runner: macos-15-intel
95 arch: intel
96 steps:
97 - uses: actions/checkout@v6
98 with:
99 path: repo
100 - name: Install dependencies
101 run: |
102 brew install cairo coreutils fontconfig gettext giflib gtk+3 gtkmm3 jpeg libpng libspiro libtiff libtool libuninameslist python@3 wget woff2 --quiet
103 PREFIX=$GITHUB_WORKSPACE/target
104 echo "PREFIX=$PREFIX" >> $GITHUB_ENV
105 echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig" >> $GITHUB_ENV
106 echo "PATH=/usr/local/opt/ruby/bin:/usr/local/opt/gettext/bin:$PATH" >> $GITHUB_ENV
107 - name: Build FontForge
108 working-directory: repo
109 run: |
110 FFCONFIG="-DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_FONTFORGE_EXTRAS=ON -DCMAKE_FIND_ROOT_PATH=/usr/local/opt/gettext"
111 mkdir build && pushd build && cmake -GNinja $FFCONFIG .. && popd
112 ninja -C build install
113 - name: Run FontForge tests
114 working-directory: repo
115 run: CTEST_PARALLEL_LEVEL=100 ninja -C build check
116 - name: Run pyhook smoke test
117 working-directory: repo
118 run: |
119 # There can be several Python versions installed. We must use the exact one discovered by CMake.
120 PYTHON=`grep -m1 'Python3_EXECUTABLE.*=' build/CMakeCache.txt | cut -d= -f2`
121 export PYTHONPATH=$PYTHONPATH:$PREFIX/$($PYTHON "$GITHUB_WORKSPACE/repo/pyhook/get_pyhook_install_dir.py" "" "APPLE")
122 $PYTHON tests/pyhook_smoketest.py
123 # Import a Developer ID certificate if one is configured. Without the
124 # MACOS_CERT_P12 secret this step is skipped and CODESIGN_IDENTITY stays
125 # unset, so the bundle is ad-hoc signed (launchable on arm64 via the
126 # Gatekeeper bypass). Populate these secrets to enable real signing (#5112).
127 - name: Import signing certificate
128 env:
129 MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
130 MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
131 MACOS_SIGN_IDENTITY: ${{ secrets.MACOS_SIGN_IDENTITY }}
132 if: env.MACOS_CERT_P12 != ''
133 run: |
134 KEYCHAIN="$RUNNER_TEMP/build.keychain-db"
135 security create-keychain -p actions "$KEYCHAIN"
136 security set-keychain-settings -lut 3600 "$KEYCHAIN"
137 security unlock-keychain -p actions "$KEYCHAIN"
138 echo "$MACOS_CERT_P12" | base64 --decode > "$RUNNER_TEMP/cert.p12"
139 security import "$RUNNER_TEMP/cert.p12" -k "$KEYCHAIN" -P "$MACOS_CERT_PASSWORD" -T /usr/bin/codesign
140 security set-key-partition-list -S apple-tool:,apple: -s -k actions "$KEYCHAIN"
141 security list-keychains -d user -s "$KEYCHAIN" $(security list-keychains -d user | tr -d '"')
142 echo "CODESIGN_IDENTITY=$MACOS_SIGN_IDENTITY" >> "$GITHUB_ENV"
143 - name: Build App Bundle
144 working-directory: repo/build
145 run: ninja macbundle
146 # Notarize + staple the dmg when notarization credentials are configured.
147 # Skipped (no-op) otherwise. Uses an App Store Connect API key.
148 - name: Notarize and staple
149 working-directory: repo/build/osx
150 env:
151 NOTARY_API_KEY: ${{ secrets.NOTARY_API_KEY }}
152 NOTARY_KEY_ID: ${{ secrets.NOTARY_KEY_ID }}
153 NOTARY_ISSUER: ${{ secrets.NOTARY_ISSUER }}
154 if: env.NOTARY_API_KEY != ''
155 run: |
156 echo "$NOTARY_API_KEY" | base64 --decode > "$RUNNER_TEMP/notary.p8"
157 DMG=$(ls FontForge-*.dmg)
158 xcrun notarytool submit "$DMG" \
159 --key "$RUNNER_TEMP/notary.p8" \
160 --key-id "$NOTARY_KEY_ID" \
161 --issuer "$NOTARY_ISSUER" \
162 --wait
163 xcrun stapler staple "$DMG"
164 - name: App Bundle artifact
165 uses: actions/upload-artifact@v7
166 with:
167 name: macOS_appbundle_${{ matrix.arch }}
168 path: repo/build/osx/FontForge-*.dmg
169
170 windows:
171 runs-on: ${{ matrix.runner }}
172 env:
173 MSYS2_FC_CACHE_SKIP: true
174 strategy:
175 matrix:
176 include:
177 - arch: UCRT64
178 runner: windows-latest
179 - arch: CLANGARM64
180 runner: windows-11-arm
181 steps:
182 - uses: actions/checkout@v6
183 with:
184 path: repo
185 fetch-depth: 0
186 - name: Setup MSYS2
187 uses: msys2/setup-msys2@v2
188 with:
189 msystem: ${{ matrix.arch }}
190 update: true
191 install: git
192 - name: Install dependencies
193 working-directory: repo/Packaging/win
194 shell: msys2 {0}
195 env:
196 BUILD_DIR: ${{ runner.temp }}/ffbuild
197 run: ./ffbuild.sh --github-actions --depsonly
198 - name: Build and package FontForge
199 working-directory: repo/Packaging/win
200 shell: msys2 {0}
201 env:
202 BUILD_DIR: ${{ runner.temp }}/ffbuild
203 run: |
204 ./ffbuild.sh --github-actions
205 FFPATH=`cygpath -m "$GITHUB_WORKSPACE/repo"` ./make-portable-package.sh ci
206 - name: Run InnoSetup
207 if: github.ref == 'refs/heads/master'
208 working-directory: repo/Packaging/win/setup
209 env:
210 BUILD_DIR: ${{ runner.temp }}/ffbuild
211 run: iscc -Qp fontforgesetup.iss -DMSYSTEM=${{ matrix.arch }} -DBUILD_DIR="${{ runner.temp }}\ffbuild"
212 - name: Build artifacts
213 uses: actions/upload-artifact@v7
214 with:
215 name: Win_${{ matrix.arch }}
216 path: |
217 repo/Packaging/win/*.7z
218 repo/Packaging/win/setup/*.exe
219
220 # Test Python module build with MSVC toolchain
221 # This ensures compatibility with Python.org Windows builds (which use MSVC)
222 windows-msvc:
223 runs-on: windows-latest
224 env:
225 VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg-cache,readwrite"
226 steps:
227 - uses: actions/checkout@v6
228 - name: Restore vcpkg binary cache
229 id: vcpkg-cache
230 uses: actions/cache/restore@v4
231 with:
232 path: vcpkg-cache
233 key: vcpkg-files-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
234 restore-keys: |
235 vcpkg-files-${{ runner.os }}-
236 - name: Create vcpkg cache directory
237 run: New-Item -ItemType Directory -Force -Path vcpkg-cache
238 - name: Setup vcpkg
239 uses: lukka/run-vcpkg@v11
240 with:
241 vcpkgJsonGlob: 'vcpkg.json'
242 - name: Setup MSVC
243 uses: ilammy/msvc-dev-cmd@v1
244 with:
245 arch: x64
246 - name: Setup Python
247 uses: actions/setup-python@v5
248 with:
249 python-version: '3.11'
250 - name: Configure
251 run: |
252 $pythonExe = (Get-Command python).Source
253 Write-Host "Using Python: $pythonExe"
254 cmake -B build -G "NMake Makefiles" `
255 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" `
256 -DCMAKE_BUILD_TYPE=Release `
257 -DPython3_EXECUTABLE="$pythonExe" `
258 -DENABLE_GUI=OFF `
259 -DENABLE_PYTHON_SCRIPTING=ON `
260 -DENABLE_PYTHON_EXTENSION=ON `
261 -DENABLE_LIBSPIRO=OFF `
262 -DENABLE_WOFF2=OFF `
263 -DENABLE_DOCS=OFF `
264 -DBUILD_SHARED_LIBS=ON
265 - name: Build
266 run: cmake --build build
267 - name: Run pyhook tests
268 run: |
269 # Copy DLLs to lib directory so Python can find them
270 Copy-Item build\bin\*.dll build\lib\ -Force
271 Copy-Item build\vcpkg_installed\x64-windows\bin\*.dll build\lib\ -Force -ErrorAction SilentlyContinue
272 ctest --test-dir build -R "_pyhook" --output-on-failure
273 - name: Save vcpkg binary cache
274 if: always()
275 uses: actions/cache/save@v4
276 with:
277 path: vcpkg-cache
278 key: vcpkg-files-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}