|
| 1 | +name: Compile Sketches |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - '**.md' |
| 7 | + pull_request: |
| 8 | + paths-ignore: |
| 9 | + - '**.md' |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +env: |
| 13 | + # It's convenient to set variables for values used multiple times in the workflow |
| 14 | + SKETCHES_REPORTS_PATH: sketches-reports |
| 15 | + SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports |
| 16 | + |
| 17 | +jobs: |
| 18 | + compile-sketches: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + - uses: arduino/compile-sketches@v1 |
| 23 | + with: |
| 24 | + enable-deltas-report: true |
| 25 | + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} |
| 26 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 27 | + fqbn: esp32:esp32:esp32s3 |
| 28 | + platforms: | # ESP32公式のpackage indexを使用する |
| 29 | + - name: esp32:esp32 |
| 30 | + source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json |
| 31 | + version: 3.1.3 |
| 32 | + sketch-paths: | |
| 33 | + - pico_classic_v4_STEP1_LED |
| 34 | + - pico_classic_v4_STEP2_SWITCH |
| 35 | + - pico_classic_v4_STEP3_Buzzer |
| 36 | + - pico_classic_v4_STEP4_Sensor |
| 37 | + - pico_classic_v4_STEP5_Straight |
| 38 | + - pico_classic_v4_STEP6_rotate |
| 39 | + - pico_classic_v4_STEP7_P_control |
| 40 | + - pico_classic_v4_STEP8_micromouse |
| 41 | +
|
| 42 | + # This step is needed to pass the size data to the report job |
| 43 | + - name: Upload sketches report to workflow artifact |
| 44 | + uses: actions/upload-artifact@v4 |
| 45 | + with: |
| 46 | + name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} |
| 47 | + path: ${{ env.SKETCHES_REPORTS_PATH }} |
| 48 | + |
| 49 | + report: |
| 50 | + needs: compile-sketches # Wait for the compile job to finish to get the data for the report |
| 51 | + if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + # This step is needed to get the size data produced by the compile jobs |
| 55 | + - name: Download sketches reports artifact |
| 56 | + uses: actions/download-artifact@v4 |
| 57 | + with: |
| 58 | + name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }} |
| 59 | + path: ${{ env.SKETCHES_REPORTS_PATH }} |
| 60 | + continue-on-error: true |
| 61 | + |
| 62 | + - uses: arduino/report-size-deltas@v1 |
| 63 | + with: |
| 64 | + sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }} |
| 65 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + continue-on-error: true |
0 commit comments