71 lines
2.3 KiB
YAML
71 lines
2.3 KiB
YAML
---
|
|
# 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@85f7611e0f7b53c8573cca84aa0ed4344f6f6a4d
|
|
env:
|
|
DEFAULT_BRANCH: main
|
|
MULTI_STATUS: false
|
|
VALIDATE_ALL_CODEBASE: false
|
|
VALIDATE_GITHUB_ACTIONS: true
|
|
|
|
- uses: systemd/mkosi@5e739ef1ed02a4f3b6ae64e50a8ee186cbcb21c2
|
|
|
|
- name: Check that tabs are not used in Python code
|
|
run: sh -c '! git grep -P "\\t" -- 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
|
|
EOF
|
|
|
|
mkosi -f sandbox -- true
|
|
|
|
- name: Run mypy
|
|
run: |
|
|
mkosi sandbox -- mypy --version
|
|
mkosi sandbox -- mypy src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
|
|
|
|
- name: Run ruff check
|
|
run: |
|
|
mkosi sandbox -- ruff --version
|
|
mkosi sandbox -- ruff check src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
|
|
|
|
- name: Run ruff format
|
|
run: |
|
|
mkosi sandbox -- ruff --version
|
|
if ! mkosi sandbox -- ruff format --check 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 sandbox -- ruff format --check --quiet --diff src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
|
|
fi
|