Skip to content

Commit 3bcdcc5

Browse files
committed
CI: merge amd64 and aarch64 code with matrix
1 parent 38f4215 commit 3bcdcc5

File tree

1 file changed

+17
-70
lines changed

1 file changed

+17
-70
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,19 @@ jobs:
6161
- name: run tests
6262
run: ctest --output-on-failure
6363

64-
linux-amd64:
65-
name: Linux-amd64
66-
runs-on: ubuntu-22.04
64+
linux-amd64-aarch64:
65+
name: Linux-${{ matrix.arch }}
66+
runs-on: ${{ matrix.runs-on }}
6767
permissions:
6868
security-events: write
6969
contents: read
70+
strategy:
71+
matrix:
72+
include:
73+
- arch: amd64
74+
runs-on: ubuntu-22.04
75+
- arch: aarch64
76+
runs-on: ubuntu-22.04-arm
7077
outputs:
7178
ffversion: ${{ steps.ffversion.outputs.ffversion }}
7279
steps:
@@ -83,25 +90,27 @@ jobs:
8390
run: cat /proc/cpuinfo
8491

8592
- name: install required packages
86-
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libddcutil-dev directx-headers-dev
93+
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libddcutil-dev libchafa-dev directx-headers-dev rpm ninja-build
8794

8895
- name: install linuxbrew packages
8996
run: |
9097
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
91-
/home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa --ignore-dependencies
98+
/home/linuxbrew/.linuxbrew/bin/brew install imagemagick --ignore-dependencies
9299
93100
- name: Initialize CodeQL
101+
if: matrix.arch == 'amd64'
94102
uses: github/codeql-action/init@v3
95103
with:
96104
languages: c
97105

98106
- name: configure project
99-
run: PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr .
107+
run: PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -GNinja -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr .
100108

101109
- name: build project
102110
run: cmake --build . --target package --verbose -j4
103111

104112
- name: perform CodeQL analysis
113+
if: matrix.arch == 'amd64'
105114
uses: github/codeql-action/analyze@v3
106115

107116
- name: list features
@@ -129,68 +138,7 @@ jobs:
129138
- name: upload artifacts
130139
uses: actions/upload-artifact@v4
131140
with:
132-
name: fastfetch-linux-amd64
133-
path: ./fastfetch-*.*
134-
135-
linux-aarch64:
136-
name: Linux-aarch64
137-
runs-on: ubuntu-22.04-arm
138-
permissions:
139-
security-events: write
140-
contents: read
141-
steps:
142-
- name: checkout repository
143-
uses: actions/checkout@v5
144-
145-
- name: uname -a
146-
run: uname -a
147-
148-
- name: cat /etc/os-release
149-
run: cat /etc/os-release
150-
151-
- name: cat /proc/cpuinfo
152-
run: cat /proc/cpuinfo
153-
154-
- name: install required packages
155-
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev directx-headers-dev libchafa-dev libddcutil-dev rpm
156-
157-
- name: install linuxbrew packages
158-
run: |
159-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
160-
/home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa --ignore-dependencies
161-
162-
- name: configure project
163-
run: PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr .
164-
165-
- name: build project
166-
run: cmake --build . --target package --verbose -j4
167-
168-
- name: list features
169-
run: ./fastfetch --list-features
170-
171-
- name: run fastfetch
172-
run: time ./fastfetch -c presets/ci.jsonc --stat false
173-
174-
- name: run fastfetch --format json
175-
run: time ./fastfetch -c presets/ci.jsonc --format json
176-
177-
- name: run flashfetch
178-
run: time ./flashfetch
179-
180-
- name: print dependencies
181-
run: ldd fastfetch
182-
183-
- name: run tests
184-
run: ctest --output-on-failure
185-
186-
- name: get fastfetch version
187-
id: ffversion
188-
run: echo "ffversion=$(./fastfetch --version-raw)" >> $GITHUB_OUTPUT
189-
190-
- name: upload artifacts
191-
uses: actions/upload-artifact@v4
192-
with:
193-
name: fastfetch-linux-aarch64
141+
name: fastfetch-linux-${{ matrix.arch }}
194142
path: ./fastfetch-*.*
195143

196144
linux-armv7l:
@@ -847,8 +795,7 @@ jobs:
847795
name: Release
848796
runs-on: ubuntu-latest
849797
needs:
850-
- linux-amd64
851-
- linux-aarch64
798+
- linux-amd64-aarch64
852799
- linux-armv7l
853800
- linux-armv6l
854801
- linux-riscv64

0 commit comments

Comments
 (0)