Debian Codegraph @

.github/workflows/delphi.yml

raw symbols SCIP
1 # ----------------------------------------------------------------------------
2 # GitHub Action workflow to test CGE with Delphi on self-hosted runners.
3 # Using self-hosted runners with Delphis installed.
4 # ----------------------------------------------------------------------------
5
6 name: Delphi Test
7
8 # Called by everything.yml
9 on: [workflow_call]
10 #on: [push, pull_request]
11
12 # Using Cygwin's bash, to avoid issues with PowerShell not having enough
13 # permissions to execute scripts (.ps1) created temporarily by GH Acions:
14 # https://github.com/actions/runner/issues/686 .
15 # There are other solutions, but just using bash is the simplest,
16 # as we already do this for most of our CI jobs, even on Windows,
17 # since bash works great and allows for cross-platform scripts.
18 defaults:
19 run:
20 shell: bash
21
22 jobs:
23 delphi_test:
24 name: Delphi Test (Job)
25 strategy:
26 matrix:
27 host-label: [
28 delphi_10_2,
29 delphi_12_1
30 ]
31
32 # Note: This is a self-hosted runner in organization,
33 # and supposed to be used by public CGE repo.
34 # It has to be enabled following https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/managing-access-to-self-hosted-runners-using-groups .
35 runs-on: ${{ matrix.host-label }}
36
37 steps:
38 - uses: actions/checkout@v4
39
40 # We want to provide multi-line scripts to "run" steps below,
41 # which isn't easy with GH Actions + Windows it seems.
42 #
43 # With PowerShell, it fails because script are unsigned:
44 # https://github.com/actions/runner/issues/686
45 #
46 # With Cygwin bash, it fails because of line endings:
47 # GH Actions create temp scripts with CRLF.
48 #
49 # Using ">" and && as workaround -- this is effectively a single line for shell.
50 # Hm, but also seems to fail, weird error about lazbuild.
51 #
52 # The igncr solution works best:
53 # https://github.com/actions/runner/issues/912
54 # https://stackoverflow.com/questions/35869168/cygwin-why-we-required-export-shellopts-set-o-igncr
55 # https://github.com/microsoft/WSL/issues/5032
56 - name: Fix bash multi-line scripts in this job
57 run: echo "SHELLOPTS=igncr" >> $GITHUB_ENV
58
59 # Check versions (and availability) of our requirements early.
60 # Note that we need FPC for Delphi test too, since our internal tools are compiled with FPC.
61 # Note: We want GNU make from Cygwin/Mingw on PATH, not Embarcadero make, not outdated make in FPC (3.8 that fails to handle $$ in make test-editor-templates).
62 - name: Info
63 run: |
64 fpc -iV
65 lazbuild --version
66 make --version
67 sed --version
68 cygpath --version
69
70 - name: Set environment - CASTLE_ENGINE_PATH
71 run: echo "CASTLE_ENGINE_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
72
73 # We need CGE build tool to run Delphi from command-line.
74 # Slower version:
75 #make clean tools install PREFIX=${CASTLE_ENGINE_PATH}/installed/
76 - name: Build Build Tool
77 run: |
78 rm -Rf installed/
79 mkdir -p installed/bin/
80 tools/build-tool/castle-engine_compile.sh
81 cp tools/build-tool/castle-engine.exe installed/bin/
82
83 - name: Set environment - BUILD_TOOL
84 run: echo "BUILD_TOOL=`cygpath --mixed \"${CASTLE_ENGINE_PATH}\"/installed/bin/castle-engine.exe`" >> $GITHUB_ENV
85 - name: Check Old Delphi-Specific AutoTests (Win64)
86 run: |
87 cd 'tests/delphi_tests/'
88 ${BUILD_TOOL} clean
89 ${BUILD_TOOL} compile --compiler=delphi --os=win64 --cpu=x86_64
90 ${BUILD_TOOL} run
91 - name: Check Old Delphi-Specific AutoTests (Win32)
92 run: |
93 cd 'tests/delphi_tests/'
94 ${BUILD_TOOL} clean
95 ${BUILD_TOOL} compile --compiler=delphi --os=win32 --cpu=i386
96 ${BUILD_TOOL} run
97 - name: Check AutoTests (Win64)
98 run: |
99 cd tests/
100 ${BUILD_TOOL} clean
101 ${BUILD_TOOL} compile --compiler=delphi --os=win64 --cpu=x86_64
102 ${BUILD_TOOL} run -- --console --no-window-create
103 - name: Check AutoTests (Win32)
104 run: |
105 cd tests/
106 ${BUILD_TOOL} clean
107 ${BUILD_TOOL} compile --compiler=delphi --os=win32 --cpu=i386
108 ${BUILD_TOOL} run -- --console --no-window-create
109 - name: Build Templates (Win64)
110 run: make test-editor-templates CASTLE_ENGINE_TOOL_OPTIONS="--compiler=delphi --os=win64 --cpu=x86_64" BUILD_TOOL="${BUILD_TOOL}"
111 - name: Build Templates (Win32)
112 run: make test-editor-templates CASTLE_ENGINE_TOOL_OPTIONS="--compiler=delphi --os=win32 --cpu=i386" BUILD_TOOL="${BUILD_TOOL}"
113
114 # Our examples do pass with Delphi 10.2, but the host with delphi_10_2
115 # is right now a really weak machine -- building Win64 examples takes 2h 45m,
116 # building Win32 examples takes 55 min. Moreover sometimes it crashes just
117 # randomly (next build of the same thing goes OK) -- not sure if it's
118 # Delphi 10.2 fault or this machine's RAM or sthg.
119 #
120 # TODO: For now, we skip "make examples-delphi" test for delphi_10_2.
121 # If we'll have better hardware, we'll resume them.
122 - name: Build Examples (Win64)
123 if: ${{ matrix.host-label != 'delphi_10_2' }}
124 run: make examples-delphi CASTLE_ENGINE_TOOL_OPTIONS="--os=win64 --cpu=x86_64" BUILD_TOOL="${BUILD_TOOL}"
125 - name: Build Examples (Win32)
126 if: ${{ matrix.host-label != 'delphi_10_2' }}
127 run: make examples-delphi CASTLE_ENGINE_TOOL_OPTIONS="--os=win32 --cpu=i386" BUILD_TOOL="${BUILD_TOOL}"
128
129 - name: Build Delphi-specific Examples (Win64)
130 run: |
131 cd examples/delphi/vcl
132 ${BUILD_TOOL} clean
133 ${BUILD_TOOL} compile --compiler=delphi --os=win64 --cpu=x86_64
134 cd ../../..
135 cd examples/delphi/fmx
136 ${BUILD_TOOL} clean
137 ${BUILD_TOOL} compile --compiler=delphi --os=win64 --cpu=x86_64
138 cd ../../..
139 - name: Build Delphi-specific Examples (Win32)
140 run: |
141 cd examples/delphi/vcl
142 ${BUILD_TOOL} clean
143 ${BUILD_TOOL} compile --compiler=delphi --os=win32 --cpu=i386
144 cd ../../..
145 cd examples/delphi/fmx
146 ${BUILD_TOOL} clean
147 ${BUILD_TOOL} compile --compiler=delphi --os=win32 --cpu=i386
148 cd ../../..