Skip to content

PIP: Update pip requirement in /.github #66

PIP: Update pip requirement in /.github

PIP: Update pip requirement in /.github #66

name: Workflow / Validate
on:
push:
pull_request:
jobs:
changes:
name: πŸ‘€ Source / Changed
runs-on: ubuntu-latest
outputs:
python: ${{ steps.changes.outputs.python }}
yaml: ${{ steps.changes.outputs.yaml }}
cpp: ${{ steps.changes.outputs.cpp }}
steps:
- name: ⬇️ Check out Repo
uses: actions/checkout@v4
- name: βš™οΈ Check for changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
python:
- '**.py'
- 'requirements.txt'
yaml:
- '**.yaml'
- '**.yml'
cpp:
- '**.cpp'
- '**.h'
python:
name: 🧹 Python Ruff
if: ${{ needs.changes.outputs.python == 'true' }}
needs:
- changes
runs-on: ubuntu-latest
steps:
- name: ⬇️ Check out Repo
uses: actions/checkout@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: πŸ“¦ Install requirements
run: python3 -m pip install -r .github/requirements.txt
- name: βš™οΈ Lint
run: python3 -m ruff check .
- name: πŸ’… Format
run: python3 -m ruff format . --check
- name: πŸ’… Format Diff
if: failure()
run: python3 -m ruff format . --check --diff
yamllint:
name: 🧹 Yaml Lint
if: ${{ needs.changes.outputs.yaml == 'true' }}
needs:
- changes
runs-on: ubuntu-latest
steps:
- name: ‡️ Check out Repo
uses: actions/checkout@v4
- name: πŸš€ Run yamllint
run: yamllint --strict .
cpplinter:
name: 🧹 C++ Lint
if: ${{ needs.changes.outputs.cpp == 'true' }}
needs:
- changes
runs-on: ubuntu-latest
steps:
- name: ‡️ Check out Repo
uses: actions/checkout@v4
- name: πŸš€ Run C++ linter
uses: cpp-linter/cpp-linter-action@v2
id: linter
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
tidy-checks: '-*'
files-changed-only: false
step-summary: true
format-review: ${{ github.event_name == 'pull_request' && 'update' }}
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
- name: Fail fast?!
if: steps.linter.outputs.checks-failed != 0
run: |
echo "Some linter checks failed. ${{ steps.linter.outputs.checks-failed }}"
exit 1
ci-status:
name: 🎭 Status
runs-on: ubuntu-latest
needs:
- python
- yamllint
- cpplinter
if: always()
steps:
- name: πŸŽ‰ Success
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: ❌ Failure
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1