From: Daan De Meyer Date: Wed, 26 Apr 2023 12:53:34 +0000 (+0200) Subject: CI fixes X-Git-Tag: v15~192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d94bd95f5989ad5beab45c7c80407d3ca4f1d804;p=thirdparty%2Fmkosi.git CI fixes --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b44adc376..ea93e425d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/action.yaml b/action.yaml index 53089136f..a154aa4d1 100644 --- a/action.yaml +++ b/action.yaml @@ -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 diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 6768c219a..5095f6d41 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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( diff --git a/mkosi/util.py b/mkosi/util.py index 526cbe953..00829469d 100644 --- a/mkosi/util.py +++ b/mkosi/util.py @@ -4,7 +4,6 @@ import ast import contextlib import enum import functools -import getpass import itertools import os import pwd diff --git a/tests/test_parse_load_args.py b/tests/test_parse_load_args.py index 9eebe3eef..b983b39e7 100644 --- a/tests/test_parse_load_args.py +++ b/tests/test_parse_load_args.py @@ -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