A repository for GitHub Actions workflow configuration for cloud-based code checking and CI/CD.
This repository provides a complete GitHub Actions workflow configuration for code checking, static analysis, and version verification on cloud virtual machines. Supports cloud checking for Python and C++ code.
- ✅ Support cloud-based virtual machine static compilation checks for C++ code (clang-tidy)
- ✅ Support cloud-based virtual machine static format checks for Python code (pylint)
- ✅ Support automatic tag version checking in the cloud
- ✅ Support automatic environment caching for faster builds
- ✅ Support triggers for Pull Request, Push, and Tags
Copy the .github folder to your project root directory.
Modify the trigger conditions in .github/workflows/ci.yml according to your needs:
on:
push:
branches:
- "**" # Run on all branch pushes
pull_request: # Run on PR
tags:
- "v*.*.*" # Run on tag creationPush your code to GitHub, and the workflow will trigger automatically:
git add .
git commit -m "Add CI workflow"
git pushCheck the workflow execution results in the "Actions" tab of your GitHub repository.
Checks all Python files to verify code standards and potential bugs.
- Configuration:
.github/config/.pylintrc - Triggers: push to branch, pull_request, repository_dispatch, workflow_call
Uses PlatformIO to compile the project and generate compile_commands.json, then performs static analysis with clang-tidy.
- Configuration:
.github/config/.clang-tidy - Compile config:
.github/config/platformio.ini - Triggers: push to branch, pull_request, repository_dispatch, workflow_call
Verifies that the tag version matches the version in library.properties.
- Triggers: Creating a version tag starting with
vorV - Permissions: Requires
contents: writepermission
common - Prepare common environment (Python, cache, etc.)
├── pylint - Python code checking
├── clang-tidy - C++ code checking
├── release - Version verification (only on tags)
└── ci-status - Summarize all check results
All configuration files are located in .github/config/:
requirements.txt: Python dependencies (pylint, etc.).pylintrc: Python pylint checking configuration.clang-tidy: C++ clang-tidy checking configurationplatformio.ini: PlatformIO compilation configuration (for generating compile_commands.json)
In .github/workflows/ci.yml:
env:
PYTHON_3: "3.11.13" # Change to your desired version- Python: Edit
.github/config/.pylintrc - C++: Edit
.github/config/.clang-tidy
In .github/workflows/ci.yml, you can comment out unneeded jobs or add conditions:
pylint:
if: false # Disable pylint- Ensure your repository has corresponding source files (.py or .cpp/.h/.ino)
- If the project doesn't need C++ checking, you can remove the
clang-tidyjob and related dependencies - Version checking requires a
library.propertiesfile in the project root - The first run may take longer to download and install dependencies