Skip to content

Commit c93fd43

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 1d14839 commit c93fd43

File tree

4 files changed

+866
-0
lines changed

4 files changed

+866
-0
lines changed

.gitlab-ci.yml

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
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+
cache:
92+
key: msys2-packages-v1
93+
paths:
94+
- C:\tools\msys64\var\cache\pacman\pkg\
95+
before_script:
96+
- choco install -y msys2
97+
- C:\tools\msys64\usr\bin\bash.exe -lc "pacman -S --noconfirm git mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config mingw-w64-x86_64-qt6-base mingw-w64-x86_64-qt6-declarative mingw-w64-x86_64-qt6-multimedia"
98+
- $env:PATH = "C:\tools\msys64\mingw64\bin;$env:PATH"
99+
script:
100+
- echo $env:CI_PIPELINE_IID > .build_id
101+
- mingw32-make sim
102+
artifacts:
103+
name: "db48x-simulator-windows-$CI_COMMIT_SHORT_SHA"
104+
paths:
105+
- sim/db48x.exe
106+
- sim/*.dll
107+
- help/
108+
expire_in: 30 days
109+
110+
build-color-simulator-windows:
111+
stage: build
112+
tags:
113+
- windows
114+
cache:
115+
key: msys2-packages-v1
116+
paths:
117+
- C:\tools\msys64\var\cache\pacman\pkg\
118+
before_script:
119+
- choco install -y msys2
120+
- C:\tools\msys64\usr\bin\bash.exe -lc "pacman -S --noconfirm git mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config mingw-w64-x86_64-qt6-base mingw-w64-x86_64-qt6-declarative mingw-w64-x86_64-qt6-multimedia"
121+
- $env:PATH = "C:\tools\msys64\mingw64\bin;$env:PATH"
122+
script:
123+
- echo $env:CI_PIPELINE_IID > .build_id
124+
- mingw32-make color-dm32-sim
125+
artifacts:
126+
name: "db50x-color-simulator-windows-$CI_COMMIT_SHORT_SHA"
127+
paths:
128+
- sim/db50x.exe
129+
- sim/*.dll
130+
- help/
131+
expire_in: 30 days
132+
133+
# WebAssembly Build
134+
build-wasm:
135+
stage: build
136+
image: fedora:latest
137+
tags:
138+
- docker
139+
before_script:
140+
- dnf install -y @development-tools git python3 curl freetype-devel pkgconfig
141+
- git clone https://github.com/emscripten-core/emsdk.git
142+
- cd emsdk
143+
- ./emsdk install latest
144+
- ./emsdk activate latest
145+
- cd ..
146+
script:
147+
- source emsdk/emsdk_env.sh
148+
- echo "$CI_PIPELINE_IID" > .build_id
149+
- make SHELL=/bin/bash wasm
150+
artifacts:
151+
name: "db48x-wasm-$CI_COMMIT_SHORT_SHA"
152+
paths:
153+
- wasm/db48x.js
154+
- wasm/db48x.wasm
155+
- wasm/*.html
156+
- help/
157+
expire_in: 30 days
158+
159+
# DM42 Firmware Build
160+
build-dm42-firmware:
161+
stage: build
162+
image: fedora:latest
163+
tags:
164+
- docker
165+
before_script:
166+
- dnf install -y @development-tools git arm-none-eabi-gcc-cs arm-none-eabi-binutils-cs arm-none-eabi-newlib freetype-devel pkgconfig
167+
script:
168+
- echo "$CI_PIPELINE_IID" > .build_id
169+
- make all || make all
170+
artifacts:
171+
name: "db48x-dm42-firmware-$CI_COMMIT_SHORT_SHA"
172+
paths:
173+
- db48x.pgm
174+
- db48x_qspi.bin
175+
- help/db48x.md
176+
- help/db48x.idx
177+
expire_in: 30 days
178+
179+
# DM32 Firmware Build
180+
build-dm32-firmware:
181+
stage: build
182+
image: fedora:latest
183+
tags:
184+
- docker
185+
before_script:
186+
- dnf install -y @development-tools git arm-none-eabi-gcc-cs arm-none-eabi-binutils-cs arm-none-eabi-newlib freetype-devel pkgconfig
187+
script:
188+
- echo "$CI_PIPELINE_IID" > .build_id
189+
- make dm32-all || make dm32-all
190+
artifacts:
191+
name: "db50x-dm32-firmware-$CI_COMMIT_SHORT_SHA"
192+
paths:
193+
- db50x.pg5
194+
- db50x_qspi.bin
195+
- help/db50x.md
196+
- help/db50x.idx
197+
expire_in: 30 days
198+
199+
# Release Package
200+
build-release-package:
201+
stage: package
202+
image: fedora:latest
203+
tags:
204+
- docker
205+
dependencies:
206+
- build-dm42-firmware
207+
- build-dm32-firmware
208+
- build-wasm
209+
script:
210+
- tar czf db48x-dm42-${CI_COMMIT_SHORT_SHA}.tar.gz db48x.pgm db48x_qspi.bin help/db48x.md help/db48x.idx
211+
- tar czf db50x-dm32-${CI_COMMIT_SHORT_SHA}.tar.gz db50x.pg5 db50x_qspi.bin help/db50x.md help/db50x.idx
212+
- tar czf db48x-wasm-${CI_COMMIT_SHORT_SHA}.tar.gz wasm/
213+
artifacts:
214+
name: "release-packages-$CI_COMMIT_SHORT_SHA"
215+
paths:
216+
- db48x-dm42-*.tar.gz
217+
- db50x-dm32-*.tar.gz
218+
- db48x-wasm-*.tar.gz
219+
expire_in: 90 days
220+
only:
221+
- stable
222+
- dev
223+

.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)