Add trunk linter #13
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: Lint | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| checks: write | |
| jobs: | |
| trunk_check: | |
| name: Trunk Check | |
| runs-on: ubuntu-latest | |
| permissions: | |
| checks: write # For trunk to post annotations | |
| contents: read # For repo checkout | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Build and Lint with ESP-IDF | |
| uses: espressif/esp-idf-ci-action@v1 | |
| with: | |
| esp_idf_version: v5.5.2 | |
| target: esp32c6 | |
| command: | | |
| idf.py build | |
| ln -s build/compile_commands.json compile_commands.json | |
| curl -fsSL https://trunk.io/releases/trunk -o /tmp/trunk-install.sh | |
| bash /tmp/trunk-install.sh -y | |
| ~/.local/bin/trunk check --ci --upstream origin/main |