]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
CI fixes
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 26 Apr 2023 12:53:34 +0000 (14:53 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 26 Apr 2023 14:02:59 +0000 (16:02 +0200)
.github/workflows/ci.yml
action.yaml
mkosi/__init__.py
mkosi/util.py
tests/test_parse_load_args.py

index b44adc376bea8f9527cc38a8f4e73b6c64ad4071..ea93e425d967888bab909344e86b7c5bb89f50fb 100644 (file)
@@ -17,21 +17,19 @@ jobs:
     steps:
     - uses: actions/checkout@v3
 
-  - name: Update systemd-analyze
-    shell: bash
-    working-directory: ${{ github.action_path }}
-    run: |
-      echo "deb-src http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
-      sudo apt-get update
-      sudo apt-get build-dep systemd
+    - name: Update systemd-analyze
+      run: |
+        echo "deb-src http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
+        sudo apt-get update
+        sudo apt-get build-dep systemd
 
-      git clone https://github.com/systemd/systemd --depth=1
-      meson systemd/build systemd
+        git clone https://github.com/systemd/systemd --depth=1
+        meson setup systemd/build systemd
 
-      ninja -C systemd/build systemd-analyze
+        ninja -C systemd/build systemd-analyze
 
-      sudo ln -svf $PWD/systemd/build/systemd-analyze /usr/bin/systemd-analyze
-      systemd-analyze --version
+        sudo ln -svf $PWD/systemd/build/systemd-analyze /usr/bin/systemd-analyze
+        systemd-analyze --version
 
     - name: Install
       run: |
@@ -51,7 +49,7 @@ jobs:
       run: python3 -m mypy mkosi/ tests/
 
     - name: Type Checking (pyright)
-      run: pyright .
+      run: pyright mkosi/ tests/
 
     - name: Unit Tests
       run: python3 -m pytest -sv tests
@@ -98,7 +96,7 @@ jobs:
     - name: Test shell scripts
       run: |
         sudo apt-get update && sudo apt-get install --no-install-recommends shellcheck
-        bash -c 'shopt -s globstar; shellcheck **/*.sh'
+        bash -c 'shopt -s globstar; shellcheck bin/mkosi tools/*.sh'
 
   integration-test:
     runs-on: ubuntu-22.04
index 53089136fabbdb8151808bf3a0434650e7f65ba8..a154aa4d1c9cc91a9bfc11fe0b4c5468ba603fab 100644 (file)
@@ -43,7 +43,7 @@ runs:
       sudo apt-get install libfdisk-dev
 
       git clone https://github.com/systemd/systemd --depth=1
-      meson systemd/build systemd -Drepart=true -Defi=true -Dbootloader=true
+      meson setup systemd/build systemd -Drepart=true -Defi=true -Dbootloader=true -Dukify=true
 
       BINARIES=(
         bootctl
index 6768c219ae7d8c6c06ca72a9780a6d752527f5de..5095f6d41f95680d4719a0d9a947fa12c3ce772b 100644 (file)
@@ -1,6 +1,5 @@
 # SPDX-License-Identifier: LGPL-2.1+
 
-import argparse
 import base64
 import contextlib
 import crypt
@@ -2024,7 +2023,7 @@ def generate_secure_boot_key(args: MkosiArgs) -> None:
         if f and not args.force:
             die(f"{f} already exists",
                 hint=("To generate new secure boot keys, "
-                      f"first remove mkosi.secure-boot.key and mkosi.secure-boot.crt"))
+                      "first remove mkosi.secure-boot.key and mkosi.secure-boot.crt"))
 
     log_step(f"Generating secure boot keys rsa:{keylength} for CN {cn!r}.")
     logging.info(
index 526cbe953ce4ab5c4f48707a6dec71befa1e1928..00829469d9e10a8249d929285e7b30a571a2dfc3 100644 (file)
@@ -4,7 +4,6 @@ import ast
 import contextlib
 import enum
 import functools
-import getpass
 import itertools
 import os
 import pwd
index 9eebe3eefa5460f3348c873b4461c0d181e6c3a9..b983b39e7092f11a93c5dbd90e2fced68fb4cd74 100644 (file)
@@ -145,7 +145,7 @@ def test_match_distribution(dist1: Distribution, dist2: Distribution) -> None:
             )
         )
 
-        conf = parse([])
+        conf = parse([])[1]
         assert "testpkg1" in conf.packages
         if dist1 == dist2:
             assert "testpkg2" in conf.packages
@@ -207,7 +207,7 @@ def test_match_release(release1: int, release2: int) -> None:
             )
         )
 
-        conf = parse([])
+        conf = parse([])[1]
         assert "testpkg1" in conf.packages
         if release1 == release2:
             assert "testpkg2" in conf.packages
@@ -283,7 +283,7 @@ def test_match_imageid(image1: str, image2: str) -> None:
             )
         )
 
-        conf = parse([])
+        conf = parse([])[1]
         assert "testpkg1" in conf.packages
         if image1 == image2:
             assert "testpkg2" in conf.packages
@@ -357,7 +357,7 @@ def test_match_imageversion(op: str, version: str) -> None:
             )
         )
 
-        conf = parse([])
+        conf = parse([])[1]
         assert ("testpkg1" in conf.packages) == opfunc(123, version)
         assert ("testpkg2" in conf.packages) == opfunc(123, version)
         assert "testpkg3" not in conf.packages