1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
---
# vi: ts=2 sw=2 et:
# SPDX-License-Identifier: LGPL-2.1-or-later
# https://github.com/marketplace/actions/super-linter
name: Lint Code Base
on:
pull_request:
branches:
- main
- v[0-9]+-stable
permissions:
contents: read
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Repo checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
# We need a full repo clone
fetch-depth: 0
- name: Lint Code Base
uses: super-linter/super-linter/slim@502f4fe48a81a392756e173e39a861f8c8efe056
env:
DEFAULT_BRANCH: main
MULTI_STATUS: false
VALIDATE_ALL_CODEBASE: false
VALIDATE_GITHUB_ACTIONS: true
LINTER_RULES_PATH: .github/linters
GITHUB_ACTIONS_CONFIG_FILE: actionlint.yml
- uses: systemd/mkosi@9e31235211d975bae25622d6205a8396d104335e
- name: Check that tabs are not used in Python code
run: sh -c '! git grep -P "\\t" -- src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py'
- name: Build tools tree
run: |
tee mkosi/mkosi.local.conf <<EOF
[Build]
ToolsTreeDistribution=fedora
ToolsTreeRelease=rawhide
ToolsTreePackages=
libgcrypt-devel
libgpg-error-devel
musl-gcc
EOF
mkosi -f box -- true
- name: Run mypy
run: |
mkosi box -- mypy --version
mkosi box -- mypy src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
- name: Run ruff format
run: |
mkosi box -- ruff --version
if ! mkosi box -- ruff format --check src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
then
echo "Please run 'ruff format' on the above files or apply the diffs below manually"
mkosi box -- ruff format --check --quiet --diff src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
fi
- name: Run ruff check
run: |
mkosi box -- ruff --version
mkosi box -- ruff check src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
- name: Configure meson
run: mkosi box -- env CC=clang CXX=clang++ meson setup -Dlocalegen-path=/usr/bin/locale-gen -Dcompat-mutable-uid-boundaries=true build
- name: Run clang-tidy
run: mkosi box -- meson test -C build --suite=clang-tidy --print-errorlogs --no-stdsplit --quiet
- name: Build with musl
run: mkosi box -- .github/workflows/build-test-musl.sh
|