Fix ModuleNotFoundError: No module named 'six' #25
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: 00-Check-Code-Convention | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| - "release/**" | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: "Branch to test" | |
| type: string | |
| default: "main" | |
| jobs: | |
| job1: | |
| name: Check coding convention | |
| runs-on: [self-hosted, jammy] #uncrustify 0.64 can not be compiled on ubuntu-24.04 | |
| steps: | |
| - name: Trigger | |
| run: echo "Triggered by ${{github.event_name}} event" | |
| - name: Check Branch Input | |
| run: | | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| if [ -z "${{ github.event.inputs.branch }}" ]; then | |
| echo "Branch input is required for manual trigger." | |
| exit 1 | |
| fi | |
| fi | |
| - name: Checkout | |
| uses: actions/checkout@v4.1.7 | |
| with: | |
| ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Log Current Branch and Commit | |
| run: | | |
| echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" | |
| echo "Current commit: $(git rev-parse HEAD)" | |
| # Workaround: coding-convention-tool image lacks python3-six, which causes | |
| # ModuleNotFoundError: No module named 'six'. Patch until upstream adds it. | |
| - name: Checkout coding convention tool | |
| uses: actions/checkout@v4.1.7 | |
| with: | |
| repository: SiliconLabsSoftware/devs-coding-convention-tool | |
| ref: master | |
| path: .github/coding-convention-tool | |
| - name: Ensure python3-six in coding convention image | |
| run: | | |
| sed -i 's/python3 python3-pip python3-venv \\/python3 python3-pip python3-venv python3-six \\/' \ | |
| .github/coding-convention-tool/Dockerfile | |
| grep -q 'python3-six' .github/coding-convention-tool/Dockerfile | |
| - name: Check Code Convention | |
| uses: ./.github/coding-convention-tool | |
| with: | |
| exclude-regex: '.*\/build\/.*|.*\/gecko_sdk.*/.*|.*\/autogen\/.*|.*simplicity.*/.*|.*\/config\/.*|.*\.slcp|.*\.slps|.*\.mak|.*\.github' | |
| codespell-ignore-words: "" | |
| codespell-skip-paths: "" |