diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d6ed692..f5b4d38 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,69 @@ -on: [push, pull_request] +name: CI + +on: + push: + branches: + - master + pull_request: + +permissions: + contents: read + jobs: lint: + name: lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: arduino/arduino-lint-action@v2 with: library-manager: update + + compile-sketches: + name: compile (${{ matrix.board.fqbn }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + board: + - fqbn: arduino:avr:uno + platforms: | + - name: arduino:avr + - fqbn: esp32:esp32:esp32 + platforms: | + - name: esp32:esp32 + source-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json + - fqbn: arduino:samd:mkrzero + platforms: | + - name: arduino:samd + - fqbn: rp2040:rp2040:rpipico + platforms: | + - name: rp2040:rp2040 + source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json + steps: + - uses: actions/checkout@v4 + - uses: arduino/compile-sketches@v1 + with: + fqbn: ${{ matrix.board.fqbn }} + platforms: ${{ matrix.board.platforms }} + libraries: | + - source-path: ./ + sketch-paths: | + - examples/si5351_calibration + - examples/si5351_clk67_example + - examples/si5351_example + - examples/si5351_ext_ref + - examples/si5351_outputs + - examples/si5351_phase + - examples/si5351_sweeper + - examples/si5351_vcxo + enable-deltas-report: true + sketches-report-path: sketches-reports + - uses: actions/upload-artifact@v4 + with: + # Artifact names must match the regex in size-deltas.yml. + name: sketches-report-${{ strategy.job-index }} + path: sketches-reports + + # Host tests: placeholder. Test design and harnesses are owned by Test Lab; + # a host-test job will be added in a separate change once Test Lab supplies it. diff --git a/.github/workflows/size-deltas.yml b/.github/workflows/size-deltas.yml new file mode 100644 index 0000000..ff61e59 --- /dev/null +++ b/.github/workflows/size-deltas.yml @@ -0,0 +1,27 @@ +name: Report size deltas + +# Runs on a schedule (per arduino/report-size-deltas docs) so it gets a +# write token and can comment on pull requests from forks. It scans recent +# workflow artifacts named sketches-report-* uploaded by the CI workflow. +# Note: scheduled workflows only run from the default branch, so this takes +# effect once merged to master. +on: + schedule: + - cron: "*/15 * * * *" + workflow_dispatch: + +permissions: + contents: read + +jobs: + report: + name: report size deltas + if: github.repository == 'etherkit/Si5351Arduino' + runs-on: ubuntu-latest + permissions: + actions: read + pull-requests: write + steps: + - uses: arduino/report-size-deltas@v1 + with: + sketches-reports-source: ^sketches-report-.+