Skip to content

Commit e91ed81

Browse files
committed
CI : sonar : fix outdated Qt dependency : nixify
1 parent fbddb5a commit e91ed81

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

.github/workflows/test_sonarcloud.yml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,29 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
- name: "Dependencies: APT"
21-
run: |
22-
sudo apt update
23-
sudo apt install -y \
24-
qt6-base-dev \
25-
catch2 \
26-
gcovr \
27-
texlive-xetex \
28-
cairosvg \
29-
imagemagick
20+
# - name: "Dependencies: APT"
21+
# run: |
22+
# sudo apt update
23+
# sudo apt install -y \
24+
# qt6-base-dev \
25+
# catch2 \
26+
# gcovr \
27+
# texlive-xetex \
28+
# cairosvg \
29+
# imagemagick
3030
# libxml2-utils
3131

32+
- name: 'Dependencies: Nix'
33+
uses: cachix/install-nix-action@v31
34+
with:
35+
nix_path: nixpkgs=channel:nixos-unstable
36+
37+
- name: Setup Nix cache
38+
uses: DeterminateSystems/magic-nix-cache-action@v13
39+
3240
- name: "Dependencies: Sonar"
3341
run: |
3442
mkdir -p /tmp/sonar
35-
wget \
36-
https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux-x64.zip \
37-
-O /tmp/sonar/sonar-scanner.zip
38-
unzip \
39-
-o /tmp/sonar/sonar-scanner.zip \
40-
-d /tmp/sonar/
4143
wget \
4244
https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip \
4345
-O /tmp/sonar/build-wrapper-linux-x86.zip
@@ -51,12 +53,16 @@ jobs:
5153
# > /tmp/report.py
5254

5355
- name: Checkout
54-
uses: actions/checkout@v3
56+
uses: actions/checkout@v4
5557
with:
5658
fetch-depth: 0
5759

60+
- name: Build Nix environment
61+
run: nix develop --no-update-lock-file --command true
62+
5863
- name: Configure
5964
run: |
65+
nix develop --no-update-lock-file --command \
6066
cmake \
6167
-S. \
6268
-Bbuild \
@@ -67,16 +73,20 @@ jobs:
6773
6874
- name: Build
6975
run: |
76+
nix develop --no-update-lock-file --command \
7077
/tmp/sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 \
7178
--out-dir build_wrapper_output_directory \
7279
cmake --build build --target all unittest
7380
7481
- name: Coverage
75-
run: cmake --build build --target coverage
82+
run: |
83+
nix develop --no-update-lock-file --command \
84+
cmake --build build --target coverage
7685
7786
- name: Scan
7887
run: |
79-
/tmp/sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux-x64/bin/sonar-scanner \
88+
nix develop --no-update-lock-file --command \
89+
sonar-scanner \
8090
-Dproject.settings=.sonar-project.properties \
8191
-Dsonar.cfamily.build-wrapper-output=build_wrapper_output_directory \
8292
-Dsonar.host.url="https://sonarcloud.io" \
@@ -117,12 +127,13 @@ jobs:
117127

118128
- name: Produce test report
119129
run: |
130+
nix develop --no-update-lock-file --command bash -c '\
120131
build/test/unit/openemsh_unittest \
121132
-r junit::out=build/test/unit/openemsh_unittest_result.xml \
122-
|| true
133+
|| true'
123134
124135
- name: Export test report
125-
uses: dorny/test-reporter@v1
136+
uses: dorny/test-reporter@v2
126137
with:
127138
name: Unit tests
128139
path: build/test/unit/openemsh_unittest_result.xml

0 commit comments

Comments
 (0)