-
-
Notifications
You must be signed in to change notification settings - Fork 13
175 lines (149 loc) · 7.39 KB
/
main.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
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
# This is a basic workflow to help you get started with Actions
name: Build push events (debug mode)
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the develop branch
on:
pull_request:
push:
paths-ignore:
- "README.md"
branches:
- master
- develop
- releases/*
workflow_dispatch:
env:
FPC_URL: 'gitlab'
FPC_BRANCH: 'release_3_2_2'
LAZ_URL: 'gitlab'
LAZ_BRANCH: 'lazarus_3_4'
LAZ_REVISION_2_4: ''
LAZ_DIR: 'fpcLaz'
BUILD_MODE: 'Debug_GH_Action'
FPCUP_OPT: '--lazopt="-g -gl" --fpcopt="-g -gl"'
LAZ_PATCH: '' #'/3p/patch/lazarus_popupmenu_click.patch' #For Lazarus 2.2
ASUITE_SOURCE: 'asuite_src'
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- os: windows-latest
name: 'Windows 64'
fpcup-url: 'https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/releases/download/v2.4.0e/fpclazup-x86_64-win64.exe'
lazbuild: 'fpcLaz/lazarus/lazbuild.exe'
dbg2mab: 'dbg2mab.exe'
build-widgetset: 'win32'
build-os: 'win64'
debug_file: 'ASuite.dbg'
- os: ubuntu-22.04
name: 'Linux 64 GTK2'
fpcup-url: 'https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/releases/download/v2.4.0e/fpclazup-x86_64-linux'
lazbuild: 'fpcLaz/lazarus/lazbuild'
dbg2mab: 'dbg2mab'
build-widgetset: 'gtk2'
build-os: 'linux'
debug_file: 'ASuite.dbg'
- os: ubuntu-22.04
name: 'Linux 64 GTK3'
fpcup-url: 'https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/releases/download/v2.4.0e/fpclazup-x86_64-linux'
lazbuild: 'fpcLaz/lazarus/lazbuild'
dbg2mab: 'dbg2mab'
build-widgetset: 'gtk3'
build-os: 'linux'
debug_file: 'ASuite.dbg'
- os: ubuntu-20.04
name: 'Linux 64 QT5'
fpcup-url: 'https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/releases/download/v2.4.0e/fpclazup-x86_64-linux'
lazbuild: 'fpcLaz/lazarus/lazbuild'
dbg2mab: 'dbg2mab'
build-widgetset: 'qt5'
build-os: 'linux'
debug_file: 'ASuite.dbg'
- os: ubuntu-22.04
name: 'Linux 64 QT6'
fpcup-url: 'https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/releases/download/v2.4.0e/fpclazup-x86_64-linux'
lazbuild: 'fpcLaz/lazarus/lazbuild'
dbg2mab: 'dbg2mab'
build-widgetset: 'qt6'
build-os: 'linux'
debug_file: 'ASuite.dbg'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
with:
submodules: true
path: '${{ env.ASUITE_SOURCE }}'
- name: Install Dependencies (Ubuntu)
if: matrix.config.os == 'ubuntu-latest' || matrix.config.os == 'ubuntu-22.04' && matrix.config.build-widgetset == 'gtk2'
run: |
sudo apt-get update
sudo apt-get -m -y install libgtk2.0-dev libpango1.0-dev libffi-dev libxtst-dev xvfb
Xvfb :1 &
- name: Install Dependencies (Ubuntu - only GTK3)
if: (matrix.config.os == 'ubuntu-latest' || matrix.config.os == 'ubuntu-22.04') && matrix.config.build-widgetset == 'gtk3'
run: sudo apt-get -m -y install libgtk-3-dev
- name: Install Dependencies (Ubuntu - only QT5)
if: (matrix.config.os == 'ubuntu-latest' || matrix.config.os == 'ubuntu-20.04') && matrix.config.build-widgetset == 'qt5'
run: |
wget https://github.com/davidbannon/libqt5pas/releases/download/v1.2.15/libqt5pas1_2.15-1_amd64.deb
wget https://github.com/davidbannon/libqt5pas/releases/download/v1.2.15/libqt5pas-dev_2.15-1_amd64.deb
sudo apt-get update
sudo apt-get -m -y install qt5-qmake qtbase5-dev qt5-default libqt5x11extras5-dev libxcb-keysyms1-dev
sudo apt-get -m -y install ./libqt5pas1_2.15-1_amd64.deb
sudo apt-get -m -y install ./libqt5pas-dev_2.15-1_amd64.deb
- name: Install Dependencies (Ubuntu - only QT6)
if: (matrix.config.os == 'ubuntu-latest' || matrix.config.os == 'ubuntu-22.04') && matrix.config.build-widgetset == 'qt6'
run: |
wget https://github.com/davidbannon/libqt6pas/releases/download/v6.2.7/libqt6pas6_6.2.7-1_amd64.deb
wget https://github.com/davidbannon/libqt6pas/releases/download/v6.2.7/libqt6pas6-dev_6.2.7-1_amd64.deb
sudo apt-get update
sudo apt-get -m -y install qt6-base-dev libxcb-keysyms1-dev libgl-dev qt6-base-private-dev
sudo apt-get -m -y install ./libqt6pas6_6.2.7-1_amd64.deb
sudo apt-get -m -y install ./libqt6pas6-dev_6.2.7-1_amd64.deb
- name: Generate Cache Hash
run: echo "${{ matrix.config.fpcup-url }}${{ env.FPCUP_OPT }}${{ env.FPC_URL }}${{ env.FPC_BRANCH }}${{ env.LAZ_URL }}${{ env.LAZ_BRANCH }}${{ env.LAZ_REVISION_2_4 }}${{ env.LAZ_PATCH}}${{ matrix.config.name }}" > .cache
- name: Cache
id: cache
uses: actions/[email protected]
env:
cache-name: cache-laz-v0.6.1
with:
path: |
${{ env.LAZ_DIR }}
${{ env.ASUITE_SOURCE }}/3p/mORMot2/static
key: ${{ runner.os }}-${{ env.cache-name }}_${{ matrix.config.build-widgetset }}-${{ hashFiles('.cache') }}
- name: Install Lazarus
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl --retry 5 -L -o fpcup ${{ matrix.config.fpcup-url }}
chmod +x fpcup
mkdir ${{ env.LAZ_DIR }}
./fpcup --installdir=${{ env.LAZ_DIR }} --fpcURL=${{ env.FPC_URL }} --fpcBranch=${{ env.FPC_BRANCH }} --lazURL=${{ env.LAZ_URL }} --lazBranch=${{ env.LAZ_BRANCH }} --lazPATCH="${{ env.ASUITE_SOURCE}}${{ env.LAZ_PATCH}}" ${{ env.FPCUP_OPT }} --only=docker --noconfirm --verbose
- name: Install Lazarus Packages
if: steps.cache.outputs.cache-hit != 'true'
shell: pwsh
run: ${{ env.ASUITE_SOURCE }}/utils/installPackages.ps1 -ASuiteSource:"${{ env.ASUITE_SOURCE }}" -LazBuildPath:"${{ matrix.config.lazbuild }}" -BuildIde:$false -RemoveSparta:$false
- name: Validate Cache
if: steps.cache.outputs.cache-hit == 'true'
run: ${{ matrix.config.lazbuild }} --version && echo "success=true" >> $GITHUB_OUTPUT || echo "success=false" >> $GITHUB_OUTPUT
- name: Build ASuite (${{ env.BUILD_MODE }})
run: ${{ matrix.config.lazbuild }} "${{ env.ASUITE_SOURCE }}/ASuite.lpi" --no-write-project --build-mode="${{ env.BUILD_MODE }}" --widgetset=${{ matrix.config.build-widgetset }}
- name: Build dbg2mab
run: ${{ matrix.config.lazbuild }} "${{ env.ASUITE_SOURCE }}/3p/dbg2mab/dbg2mab.lpi" --no-write-project --widgetset=${{ matrix.config.build-widgetset }}
- name: Embedded debug info in asuite executable
#if: matrix.config.build-widgetset != 'gtk2'
run: ${{ env.ASUITE_SOURCE }}/bin/${{ matrix.config.dbg2mab }} ${{ env.ASUITE_SOURCE }}/bin/${{ matrix.config.debug_file }}
- name: Upload the Build Artifact
uses: actions/[email protected]
with:
name: ASuite ${{ env.BUILD_MODE }} build - ${{ matrix.config.build-widgetset }}
path: |
${{ env.ASUITE_SOURCE}}/bin