Skip to content

Commit 8cca60d

Browse files
committed
gitlab: Add build pipelines for gitlab
Add the same build pipelines on GitLab as on GitHub Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
1 parent 98e7c15 commit 8cca60d

File tree

4 files changed

+857
-0
lines changed

4 files changed

+857
-0
lines changed

.gitlab-ci.yml

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
stages:
2+
- build
3+
- package
4+
5+
variables:
6+
GIT_SUBMODULE_STRATEGY: recursive
7+
8+
# macOS Simulator Builds
9+
build-simulator-macos:
10+
stage: build
11+
tags:
12+
- macos
13+
before_script:
14+
- brew install qt@6
15+
- export PATH="/usr/local/opt/qt@6/bin:$PATH"
16+
script:
17+
- echo "$CI_PIPELINE_IID" > .build_id
18+
- make sim
19+
artifacts:
20+
name: "db48x-simulator-macos-$CI_COMMIT_SHORT_SHA"
21+
paths:
22+
- sim/db48x.app
23+
- help/
24+
expire_in: 30 days
25+
26+
build-color-simulator-macos:
27+
stage: build
28+
tags:
29+
- macos
30+
before_script:
31+
- brew install qt@6
32+
- export PATH="/usr/local/opt/qt@6/bin:$PATH"
33+
script:
34+
- echo "$CI_PIPELINE_IID" > .build_id
35+
- make color-dm32-sim
36+
artifacts:
37+
name: "db50x-color-simulator-macos-$CI_COMMIT_SHORT_SHA"
38+
paths:
39+
- sim/db50x.app
40+
- help/
41+
expire_in: 30 days
42+
43+
# Linux Simulator Builds
44+
build-simulator-linux:
45+
stage: build
46+
image: fedora:latest
47+
tags:
48+
- docker
49+
before_script:
50+
- dnf install -y @development-tools git python3 python3-pip libxcb-devel mesa-libGL-devel libxkbcommon-x11-devel freetype-devel pkgconfig xcb-util-wm-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel
51+
- python3 -m pip install aqtinstall
52+
- python3 -m aqt install-qt linux desktop 6.5.3 --outputdir /opt/Qt --modules qtmultimedia
53+
- export PATH="/opt/Qt/6.5.3/gcc_64/bin:$PATH"
54+
- export QT_QPA_PLATFORM=offscreen
55+
script:
56+
- echo "$CI_PIPELINE_IID" > .build_id
57+
- make sim
58+
artifacts:
59+
name: "db48x-simulator-linux-$CI_COMMIT_SHORT_SHA"
60+
paths:
61+
- sim/db48x
62+
- help/
63+
expire_in: 30 days
64+
65+
build-color-simulator-linux:
66+
stage: build
67+
image: fedora:latest
68+
tags:
69+
- docker
70+
before_script:
71+
- dnf install -y @development-tools git python3 python3-pip libxcb-devel mesa-libGL-devel libxkbcommon-x11-devel freetype-devel pkgconfig xcb-util-wm-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel
72+
- python3 -m pip install aqtinstall
73+
- python3 -m aqt install-qt linux desktop 6.5.3 --outputdir /opt/Qt --modules qtmultimedia
74+
- export PATH="/opt/Qt/6.5.3/gcc_64/bin:$PATH"
75+
- export QT_QPA_PLATFORM=offscreen
76+
script:
77+
- echo "$CI_PIPELINE_IID" > .build_id
78+
- make color-dm32-sim
79+
artifacts:
80+
name: "db50x-color-simulator-linux-$CI_COMMIT_SHORT_SHA"
81+
paths:
82+
- sim/db50x
83+
- help/
84+
expire_in: 30 days
85+
86+
# Windows Simulator Builds
87+
build-simulator-windows:
88+
stage: build
89+
tags:
90+
- windows
91+
before_script:
92+
- choco install -y python
93+
- python -m pip install aqtinstall
94+
- python -m aqt install-qt windows desktop 6.7.3 win64_mingw --outputdir C:\Qt --modules qtmultimedia --tools tools_mingw90
95+
- $env:PATH = "C:\Qt\6.7.3\mingw_64\bin;C:\Qt\Tools\mingw1120_64\bin;$env:PATH"
96+
script:
97+
- echo $env:CI_PIPELINE_IID > .build_id
98+
- mingw32-make sim
99+
artifacts:
100+
name: "db48x-simulator-windows-$CI_COMMIT_SHORT_SHA"
101+
paths:
102+
- sim/db48x.exe
103+
- sim/*.dll
104+
- help/
105+
expire_in: 30 days
106+
107+
build-color-simulator-windows:
108+
stage: build
109+
tags:
110+
- windows
111+
before_script:
112+
- choco install -y python
113+
- python -m pip install aqtinstall
114+
- python -m aqt install-qt windows desktop 6.7.3 win64_mingw --outputdir C:\Qt --modules qtmultimedia --tools tools_mingw90
115+
- $env:PATH = "C:\Qt\6.7.3\mingw_64\bin;C:\Qt\Tools\mingw1120_64\bin;$env:PATH"
116+
script:
117+
- echo $env:CI_PIPELINE_IID > .build_id
118+
- mingw32-make color-dm32-sim
119+
artifacts:
120+
name: "db50x-color-simulator-windows-$CI_COMMIT_SHORT_SHA"
121+
paths:
122+
- sim/db50x.exe
123+
- sim/*.dll
124+
- help/
125+
expire_in: 30 days
126+
127+
# WebAssembly Build
128+
build-wasm:
129+
stage: build
130+
image: fedora:latest
131+
tags:
132+
- docker
133+
before_script:
134+
- dnf install -y @development-tools git python3 curl freetype-devel pkgconfig
135+
- git clone https://github.com/emscripten-core/emsdk.git
136+
- cd emsdk
137+
- ./emsdk install latest
138+
- ./emsdk activate latest
139+
- cd ..
140+
script:
141+
- source emsdk/emsdk_env.sh
142+
- echo "$CI_PIPELINE_IID" > .build_id
143+
- make SHELL=/bin/bash wasm
144+
artifacts:
145+
name: "db48x-wasm-$CI_COMMIT_SHORT_SHA"
146+
paths:
147+
- wasm/db48x.js
148+
- wasm/db48x.wasm
149+
- wasm/*.html
150+
- help/
151+
expire_in: 30 days
152+
153+
# DM42 Firmware Build
154+
build-dm42-firmware:
155+
stage: build
156+
image: fedora:latest
157+
tags:
158+
- docker
159+
before_script:
160+
- dnf install -y @development-tools git arm-none-eabi-gcc-cs arm-none-eabi-binutils-cs arm-none-eabi-newlib freetype-devel pkgconfig
161+
script:
162+
- echo "$CI_PIPELINE_IID" > .build_id
163+
- make all || make all
164+
artifacts:
165+
name: "db48x-dm42-firmware-$CI_COMMIT_SHORT_SHA"
166+
paths:
167+
- db48x.pgm
168+
- db48x_qspi.bin
169+
- help/db48x.md
170+
- help/db48x.idx
171+
expire_in: 30 days
172+
173+
# DM32 Firmware Build
174+
build-dm32-firmware:
175+
stage: build
176+
image: fedora:latest
177+
tags:
178+
- docker
179+
before_script:
180+
- dnf install -y @development-tools git arm-none-eabi-gcc-cs arm-none-eabi-binutils-cs arm-none-eabi-newlib freetype-devel pkgconfig
181+
script:
182+
- echo "$CI_PIPELINE_IID" > .build_id
183+
- make dm32-all || make dm32-all
184+
artifacts:
185+
name: "db50x-dm32-firmware-$CI_COMMIT_SHORT_SHA"
186+
paths:
187+
- db50x.pg5
188+
- db50x_qspi.bin
189+
- help/db50x.md
190+
- help/db50x.idx
191+
expire_in: 30 days
192+
193+
# Release Package
194+
build-release-package:
195+
stage: package
196+
image: fedora:latest
197+
tags:
198+
- docker
199+
dependencies:
200+
- build-dm42-firmware
201+
- build-dm32-firmware
202+
- build-wasm
203+
script:
204+
- tar czf db48x-dm42-${CI_COMMIT_SHORT_SHA}.tar.gz db48x.pgm db48x_qspi.bin help/db48x.md help/db48x.idx
205+
- tar czf db50x-dm32-${CI_COMMIT_SHORT_SHA}.tar.gz db50x.pg5 db50x_qspi.bin help/db50x.md help/db50x.idx
206+
- tar czf db48x-wasm-${CI_COMMIT_SHORT_SHA}.tar.gz wasm/
207+
artifacts:
208+
name: "release-packages-$CI_COMMIT_SHORT_SHA"
209+
paths:
210+
- db48x-dm42-*.tar.gz
211+
- db50x-dm32-*.tar.gz
212+
- db48x-wasm-*.tar.gz
213+
expire_in: 90 days
214+
only:
215+
- stable
216+
- dev
217+

.gitlab/BADGES.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# GitLab CI/CD Pipeline Badges
2+
3+
This document provides badge templates for displaying build status in your README or documentation.
4+
5+
## Pipeline Status Badge
6+
7+
Overall pipeline status:
8+
9+
```markdown
10+
[![Pipeline Status](https://gitlab.com/YOUR_USERNAME/db48x/badges/dev/pipeline.svg)](https://gitlab.com/YOUR_USERNAME/db48x/-/pipelines)
11+
```
12+
13+
For stable branch:
14+
```markdown
15+
[![Pipeline Status](https://gitlab.com/YOUR_USERNAME/db48x/badges/stable/pipeline.svg)](https://gitlab.com/YOUR_USERNAME/db48x/-/pipelines)
16+
```
17+
18+
## Coverage Badge (if tests are added)
19+
20+
```markdown
21+
[![Coverage](https://gitlab.com/YOUR_USERNAME/db48x/badges/dev/coverage.svg)](https://gitlab.com/YOUR_USERNAME/db48x/-/pipelines)
22+
```
23+
24+
## Individual Job Badges
25+
26+
GitLab doesn't provide individual job badges by default, but you can use shields.io:
27+
28+
### Simulator Builds
29+
30+
**macOS Simulator:**
31+
```markdown
32+
![macOS Simulator](https://img.shields.io/badge/build-macOS%20simulator-blue)
33+
```
34+
35+
**Linux Simulator:**
36+
```markdown
37+
![Linux Simulator](https://img.shields.io/badge/build-Linux%20simulator-blue)
38+
```
39+
40+
**Windows Simulator:**
41+
```markdown
42+
![Windows Simulator](https://img.shields.io/badge/build-Windows%20simulator-blue)
43+
```
44+
45+
### Color DM32 Simulator Builds
46+
47+
**macOS Color Simulator:**
48+
```markdown
49+
![macOS Color Simulator](https://img.shields.io/badge/build-macOS%20color%20simulator-green)
50+
```
51+
52+
**Linux Color Simulator:**
53+
```markdown
54+
![Linux Color Simulator](https://img.shields.io/badge/build-Linux%20color%20simulator-green)
55+
```
56+
57+
**Windows Color Simulator:**
58+
```markdown
59+
![Windows Color Simulator](https://img.shields.io/badge/build-Windows%20color%20simulator-green)
60+
```
61+
62+
### Other Builds
63+
64+
**WASM:**
65+
```markdown
66+
![WASM Build](https://img.shields.io/badge/build-WebAssembly-orange)
67+
```
68+
69+
**DM42 Firmware:**
70+
```markdown
71+
![DM42 Firmware](https://img.shields.io/badge/build-DM42%20firmware-red)
72+
```
73+
74+
**DM32 Firmware:**
75+
```markdown
76+
![DM32 Firmware](https://img.shields.io/badge/build-DM32%20firmware-red)
77+
```
78+
79+
## Latest Release Badge
80+
81+
```markdown
82+
[![Latest Release](https://gitlab.com/YOUR_USERNAME/db48x/-/badges/release.svg)](https://gitlab.com/YOUR_USERNAME/db48x/-/releases)
83+
```
84+
85+
## Example README Section
86+
87+
Here's how you might include these badges in your README:
88+
89+
```markdown
90+
# DB48X Calculator
91+
92+
[![Pipeline Status](https://gitlab.com/YOUR_USERNAME/db48x/badges/dev/pipeline.svg)](https://gitlab.com/YOUR_USERNAME/db48x/-/pipelines)
93+
[![Latest Release](https://gitlab.com/YOUR_USERNAME/db48x/-/badges/release.svg)](https://gitlab.com/YOUR_USERNAME/db48x/-/releases)
94+
95+
## Build Status
96+
97+
| Platform | Status |
98+
|----------|--------|
99+
| macOS Simulator | ![macOS Simulator](https://img.shields.io/badge/build-passing-brightgreen) |
100+
| Linux Simulator | ![Linux Simulator](https://img.shields.io/badge/build-passing-brightgreen) |
101+
| Windows Simulator | ![Windows Simulator](https://img.shields.io/badge/build-passing-brightgreen) |
102+
| WASM | ![WASM Build](https://img.shields.io/badge/build-passing-brightgreen) |
103+
| DM42 Firmware | ![DM42 Firmware](https://img.shields.io/badge/build-passing-brightgreen) |
104+
| DM32 Firmware | ![DM32 Firmware](https://img.shields.io/badge/build-passing-brightgreen) |
105+
```
106+
107+
## Custom Badges with Shields.io
108+
109+
You can create custom dynamic badges using the GitLab API and shields.io:
110+
111+
### Pipeline Status
112+
```markdown
113+
![Pipeline](https://img.shields.io/gitlab/pipeline/YOUR_USERNAME/db48x/dev)
114+
```
115+
116+
### Last Commit
117+
```markdown
118+
![Last Commit](https://img.shields.io/gitlab/last-commit/YOUR_USERNAME/db48x)
119+
```
120+
121+
### Tag/Release
122+
```markdown
123+
![Tag](https://img.shields.io/gitlab/v/tag/YOUR_USERNAME/db48x)
124+
```
125+
126+
### Stars
127+
```markdown
128+
![Stars](https://img.shields.io/gitlab/stars/YOUR_USERNAME/db48x)
129+
```
130+
131+
### Forks
132+
```markdown
133+
![Forks](https://img.shields.io/gitlab/forks/YOUR_USERNAME/db48x)
134+
```
135+
136+
## Notes
137+
138+
- Replace `YOUR_USERNAME` with your actual GitLab username or group name
139+
- Replace `db48x` with your repository name if different
140+
- Badges update automatically based on pipeline results
141+
- For private repositories, you may need to configure badge access tokens
142+
- GitLab's built-in badges are available at: Settings > CI/CD > General pipelines > Pipeline status
143+

0 commit comments

Comments
 (0)