2024-06-22 06:01:48 -04:00
|
|
|
# yamllint disable-line rule:line-length
|
2024-01-29 10:49:54 -05:00
|
|
|
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
2023-11-13 09:33:28 -05:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
---
|
|
|
|
name: Lint
|
|
|
|
|
|
|
|
# yamllint disable-line rule:truthy
|
|
|
|
on:
|
|
|
|
# yamllint disable-line rule:empty-values
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- reopened
|
|
|
|
- synchronize
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ci-${{ github.ref }}-1
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
2024-06-22 04:37:20 -04:00
|
|
|
runs-on: ubuntu-24.04
|
2023-11-13 09:33:28 -05:00
|
|
|
steps:
|
2024-07-08 11:11:12 -04:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-python@v5
|
2023-11-13 09:33:28 -05:00
|
|
|
- name: Update package list
|
|
|
|
run: sudo apt-get -y update
|
|
|
|
- name: Install OS packages
|
|
|
|
# yamllint disable-line rule:line-length
|
2024-07-08 11:06:00 -04:00
|
|
|
run: sudo apt-get install -y $(cat dependencies/debian.txt)
|
2024-06-22 06:01:48 -04:00
|
|
|
- name: Remove externally managed python environment flag
|
|
|
|
# yamllint disable-line rule:line-length
|
|
|
|
run: sudo dpkg-divert --rename --add /usr/lib/$(py3versions -d)/EXTERNALLY-MANAGED
|
2023-11-13 09:33:28 -05:00
|
|
|
- name: Install pip packages
|
2024-07-08 11:06:00 -04:00
|
|
|
run: pip3 install $(cat dependencies/pip.txt)
|
2024-07-07 09:25:23 -04:00
|
|
|
- uses: pre-commit/action@v3.0.1
|
2024-06-22 06:23:46 -04:00
|
|
|
env:
|
|
|
|
SPEC_VENDOR: Github Actions
|
2024-06-24 05:17:58 -04:00
|
|
|
SPEC_PACKAGER: Github Actions
|
2024-07-08 11:06:00 -04:00
|
|
|
- uses: editorconfig-checker/action-editorconfig-checker@main
|
|
|
|
- name: Run Editorconfig Checker
|
|
|
|
run: editorconfig-checker
|
2023-11-13 09:33:28 -05:00
|
|
|
- name: Lint commits
|
|
|
|
# yamllint disable-line rule:line-length
|
|
|
|
run: |
|
2024-01-28 17:13:24 -05:00
|
|
|
if test "${{ github.event_name}}" = "pull_request"
|
2023-11-13 09:33:28 -05:00
|
|
|
then
|
2024-01-28 17:13:24 -05:00
|
|
|
base="${{ github.event.pull_request.base.sha }}"
|
|
|
|
head="${{ github.event.pull_request.head.sha }}"
|
2023-11-13 09:33:28 -05:00
|
|
|
else
|
2024-01-28 17:13:24 -05:00
|
|
|
base="${{ github.event.before }}"
|
|
|
|
head="${{ github.event.after }}"
|
|
|
|
fi
|
|
|
|
if test "${base}" = "${head}" || test -z "${base}"
|
|
|
|
then
|
|
|
|
gitlint --debug --commit "${head}"
|
|
|
|
else
|
|
|
|
gitlint --debug --commits "${base}..${head}"
|
2023-11-13 09:33:28 -05:00
|
|
|
fi
|