Automate plugin metadata insertion #1310
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request_target: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install -U pip | |
| python -m pip install -U pycodestyle==2.12.1 autopep8 | |
| python -m pip install -U -r test/pip_reqs.txt | |
| - name: Apply AutoPEP8 | |
| run: | | |
| autopep8 --in-place --recursive --max-line-length=100 . | |
| - name: Commit AutoPEP8 | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: "[ci] auto-format" | |
| branch: ${{ github.head_ref }} | |
| - name: Apply Plugin Metadata | |
| run: | | |
| LAST_COMMIT_HASH=$(git log --pretty=format:'%H' -n 1) | |
| CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r "$LAST_COMMIT_HASH") | |
| python test/auto_apply_plugin_metadata.py "$CHANGED_FILES" | |
| - name: Apply Version Metadata | |
| run: | | |
| python test/auto_apply_version_metadata.py $(git log --pretty=format:'%h' -n 1) | |
| - name: Commit Plugin Metadata | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: "[ci] apply-version-metadata" | |
| branch: ${{ github.head_ref }} | |
| - name: Execute Tests | |
| run: | | |
| python -m unittest discover -v |