Skip to content

Commit

Permalink
Feat: Patch linting setup during standalone lint check workflow (#91)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Watkins <[email protected]>
  • Loading branch information
ModeSevenIndustrialSolutions authored Jul 29, 2024
1 parent b74699b commit 9fb321b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 17 deletions.
27 changes: 13 additions & 14 deletions .github/actions/semantic-tag-increment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,22 @@ runs:
### CONTENT RECENTLY ADDED ###
case "$TYPE" in
major)
((MAJOR += 1))
((MINOR = 0))
((PATCH = 0))
;;
minor)
((MINOR += 1))
((PATCH = 0))
;;
patch)
((PATCH += 1))
;;
major)
((MAJOR += 1))
((MINOR = 0))
((PATCH = 0))
;;
minor)
((MINOR += 1))
((PATCH = 0))
;;
patch)
((PATCH += 1))
;;
esac
INCREMENTED="$MAJOR.$MINOR.$PATCH"
echo "$MAJOR.$MINOR.$PATCH"
### CONTENT REMOVED ###
echo "Incremented: ${INCREMENTED}"
echo "tag=${TAG}" >> $GITHUB_OUTPUT
45 changes: 42 additions & 3 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 The Linux Foundation <https://linuxfoundation.org>

name: "⛔️ Standalone Linting Checks"
name: "Standalone Linting Checks"

# yamllint disable-line rule:truthy
on:
Expand All @@ -15,7 +15,7 @@ on:

jobs:
linting:
name: "Unsupported by pre-commit.ci"
# name: "Unsupported by pre-commit.ci"
runs-on: "ubuntu-latest"
# Don't run when pull request is merged
if: github.event.pull_request.merged == false
Expand All @@ -29,8 +29,47 @@ jobs:
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Install linting tools"
- name: "Patch linting configuration"
run: |
# Patch the linting configuration
# This step prevents a bunch of tools being installed
# (which substantically increases workflow execution time)
mv .pre-commit-config.yaml .pre-commit-config.yaml.previous
cat << 'EOF' > .pre-commit-config.yaml
---
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 The Linux Foundation <https://linuxfoundation.org>
ci:
autofix_commit_msg: "Chore: pre-commit autoupdate"
exclude: |
(?x)^(
docs\/conf.py|
dco-signoffs/$
)$
repos:
- repo: local
hooks:
- id: mypy-cache
name: "create mypy cache"
language: system
pass_filenames: false
entry: bash -c 'if [ ! -d .mypy_cache ]; then /bin/mkdir .mypy_cache; fi; exit 0'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.11.0"
hooks:
- id: mypy
verbose: true
args: ["--show-error-codes", "--install-types", "--non-interactive"]
additional_dependencies: ["pytest", "types-requests"]
EOF
- name: "Install linting dependencies"
run: |
# Install linting dependencies
pip install --upgrade pip
pip install pre-commit mypy
Expand Down

0 comments on commit 9fb321b

Please sign in to comment.