Skip to content

Commit 1543122

Browse files
dwsuseigaw
authored andcommitted
build: Use containers with matrix build
Use a matrix build approach and a base container which already contains all the libraries installed.
1 parent 5a1fdb0 commit 1543122

7 files changed

Lines changed: 96 additions & 220 deletions

File tree

.github/cross/clang.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/cross/ubuntu-static.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 46 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,22 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
gcc-debug:
14-
name: gcc debug
13+
default:
1514
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
compiler: [gcc, clang]
18+
buildtype: [debug, release]
19+
container:
20+
image: ghcr.io/igaw/linux-nvme/debian:0.30
1621
steps:
17-
- name: install libraries
18-
run: sudo apt-get install meson gcc pkg-config libjson-c-dev libssl-dev python3-dev
1922
- uses: actions/checkout@v3
2023
- uses: actions/setup-python@v4
2124
with:
2225
python-version: '3.x'
2326
- name: build
2427
run: |
25-
scripts/build.sh -b debug -c gcc
28+
scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }}
2629
- uses: actions/upload-artifact@v3
2730
name: upload logs
2831
if: failure()
@@ -31,61 +34,39 @@ jobs:
3134
path: |
3235
.build-ci/meson-logs/*.txt
3336
34-
gcc-release:
35-
name: gcc release
37+
cross:
3638
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
include:
42+
- arch: armhf
43+
port: armhf
44+
compiler: gcc-arm-linux-gnueabihf
45+
packages:
46+
- arch: s390x
47+
port: s390x
48+
compiler: gcc-s390x-linux-gnu
49+
packages: libgcc-s1:s390x
50+
- arch: ppc64le
51+
port: ppc64el
52+
compiler: gcc-powerpc64le-linux-gnu
53+
packges:
3754
steps:
38-
- name: install libraries
39-
run: sudo apt-get install meson gcc pkg-config libjson-c-dev libdbus-1-dev python3-dev
4055
- uses: actions/checkout@v3
41-
- uses: actions/setup-python@v4
42-
with:
43-
python-version: '3.x'
44-
- name: build
45-
run: |
46-
scripts/build.sh -b release -c gcc libdbus
47-
- uses: actions/upload-artifact@v3
48-
name: upload logs
49-
if: failure()
50-
with:
51-
name: log files
52-
path: |
53-
.build-ci/meson-logs/*.txt
54-
55-
gcc-release-static:
56-
name: gcc release static
57-
runs-on: ubuntu-latest
58-
steps:
59-
- name: install libraries
60-
run: sudo apt-get install meson gcc pkg-config libpam-dev libcap-ng-dev
61-
- uses: actions/checkout@v3
62-
- uses: actions/setup-python@v4
63-
with:
64-
python-version: '3.x'
65-
- name: build
56+
- name: set up arm architecture
6657
run: |
67-
scripts/build.sh -b release -c gcc static
68-
- uses: actions/upload-artifact@v3
69-
name: upload logs
70-
if: failure()
71-
with:
72-
name: log files
73-
path: |
74-
.build-ci/meson-logs/*.txt
75-
76-
clang-debug:
77-
name: clang debug
78-
runs-on: ubuntu-latest
79-
steps:
80-
- name: install libraries
81-
run: sudo apt-get install meson clang pkg-config libjson-c-dev libdbus-1-dev python3-dev
82-
- uses: actions/checkout@v3
83-
- uses: actions/setup-python@v4
84-
with:
85-
python-version: '3.x'
58+
export release=$(lsb_release -c -s)
59+
sudo dpkg --add-architecture ${{ matrix.port }}
60+
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
61+
sudo dd of=/etc/apt/sources.list.d/${{ matrix.arch }}.list <<EOF
62+
deb [arch=${{ matrix.port }}] http://ports.ubuntu.com/ $release main universe restricted"
63+
deb [arch=${{ matrix.port }}] http://ports.ubuntu.com/ $release-updates main universe restricted"
64+
EOF
65+
sudo apt update
66+
sudo apt install -y meson pkg-config qemu-user-static ${{ matrix.compiler}} libjson-c-dev:${{ matrix.port }} ${{ matrix.packages }}
8667
- name: build
8768
run: |
88-
scripts/build.sh -b debug -c clang libdbus
69+
scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross
8970
- uses: actions/upload-artifact@v3
9071
name: upload logs
9172
if: failure()
@@ -94,19 +75,19 @@ jobs:
9475
path: |
9576
.build-ci/meson-logs/*.txt
9677
97-
clang-release:
98-
name: clang release
78+
libdbus:
79+
name: libdbus
9980
runs-on: ubuntu-latest
81+
container:
82+
image: ghcr.io/igaw/linux-nvme/debian:0.30
10083
steps:
101-
- name: install libraries
102-
run: sudo apt-get install meson clang pkg-config libjson-c-dev libdbus-1-dev python3-dev
10384
- uses: actions/checkout@v3
10485
- uses: actions/setup-python@v4
10586
with:
10687
python-version: '3.x'
10788
- name: build
10889
run: |
109-
scripts/build.sh -b release -c clang libdbus
90+
scripts/build.sh -b release -c gcc libdbus
11091
- uses: actions/upload-artifact@v3
11192
name: upload logs
11293
if: failure()
@@ -118,9 +99,10 @@ jobs:
11899
fallback-shared-libraries:
119100
name: fallback shared libraries
120101
runs-on: ubuntu-latest
102+
container:
103+
image: ghcr.io/igaw/linux-nvme/debian:0.30
104+
if: github.ref == 'refs/heads/master'
121105
steps:
122-
- name: install libraries
123-
run: sudo apt-get install meson gcc pkg-config libpam-dev libcap-ng-dev
124106
- uses: actions/checkout@v3
125107
- uses: actions/setup-python@v4
126108
with:
@@ -135,99 +117,11 @@ jobs:
135117
path: |
136118
.build-ci/meson-logs/*.txt
137119
138-
cross-armhf:
139-
name: cross armhf
140-
runs-on: ubuntu-latest
141-
steps:
142-
- name: set up arm architecture
143-
run: |
144-
export release=$(lsb_release -c -s)
145-
sudo dpkg --add-architecture armhf
146-
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
147-
sudo dd of=/etc/apt/sources.list.d/armhf.list <<EOF
148-
deb [arch=armhf] http://ports.ubuntu.com/ $release main universe restricted"
149-
deb [arch=armhf] http://ports.ubuntu.com/ $release-updates main universe restricted"
150-
EOF
151-
sudo apt update
152-
- name: install armhf compiler
153-
run: sudo apt install meson gcc-arm-linux-gnueabihf pkg-config qemu-user-static
154-
- name: install libraries
155-
run: sudo apt install libjson-c-dev:armhf
156-
- uses: actions/checkout@v3
157-
- name: build
158-
run: |
159-
scripts/build.sh -b release -c gcc cross_armhf
160-
- uses: actions/upload-artifact@v3
161-
name: upload logs
162-
if: failure()
163-
with:
164-
name: log files
165-
path: |
166-
.build-ci/meson-logs/*.txt
167-
168-
cross-ppc64le:
169-
name: cross ppc64le
170-
runs-on: ubuntu-latest
171-
steps:
172-
- name: set up ppc64le architecture
173-
run: |
174-
export release=$(lsb_release -c -s)
175-
sudo dpkg --add-architecture ppc64el
176-
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
177-
sudo dd of=/etc/apt/sources.list.d/ppc64el.list <<EOF
178-
deb [arch=ppc64el] http://ports.ubuntu.com/ $release main universe restricted"
179-
deb [arch=ppc64el] http://ports.ubuntu.com/ $release-updates main universe restricted"
180-
EOF
181-
sudo apt update
182-
- name: install powerpc64le compiler
183-
run: sudo apt install meson gcc-powerpc64le-linux-gnu pkg-config qemu-user-static
184-
- name: install libraries
185-
run: sudo apt install libjson-c-dev:ppc64el
186-
- uses: actions/checkout@v3
187-
- name: build
188-
run: |
189-
scripts/build.sh -b release -c gcc cross_ppc64le
190-
- uses: actions/upload-artifact@v3
191-
name: upload logs
192-
if: failure()
193-
with:
194-
name: log files
195-
path: |
196-
.build-ci/meson-logs/*.txt
197-
198-
cross-s390x:
199-
name: cross s390x
200-
runs-on: ubuntu-latest
201-
steps:
202-
- name: set up s390x architecture
203-
run: |
204-
export release=$(lsb_release -c -s)
205-
sudo dpkg --add-architecture s390x
206-
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
207-
sudo dd of=/etc/apt/sources.list.d/s390x.list <<EOF
208-
deb [arch=s390x] http://ports.ubuntu.com/ $release main universe restricted"
209-
deb [arch=s390x] http://ports.ubuntu.com/ $release-updates main universe restricted"
210-
EOF
211-
sudo apt update
212-
- name: install s390x compiler
213-
run: sudo apt install meson gcc-s390x-linux-gnu libgcc-s1:s390x pkg-config qemu-user-static
214-
- name: install libraries
215-
run: sudo apt install libjson-c-dev:s390x
216-
- uses: actions/checkout@v3
217-
- name: build
218-
run: |
219-
scripts/build.sh -b release -c gcc cross_s390x
220-
- uses: actions/upload-artifact@v3
221-
name: upload logs
222-
if: failure()
223-
with:
224-
name: log files
225-
path: |
226-
.build-ci/meson-logs/*.txt
227-
228120
build-muon:
229-
name: muon minimal
121+
name: muon minimal static
230122
runs-on: ubuntu-latest
123+
container:
124+
image: ghcr.io/igaw/linux-nvme/debian:0.30
231125
steps:
232126
- uses: actions/checkout@v3
233127
- name: build

0 commit comments

Comments
 (0)