diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f2bfa72 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# See: https://docs.github.com/en/code-security/supply-chain-security/configuration-options-for-dependency-updates#about-the-dependabotyml-file +version: 2 + +updates: + # Configure check for outdated GitHub Actions actions in workflows. + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/dependabot/README.md + # See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-actions-up-to-date-with-dependabot + - package-ecosystem: github-actions + directory: / # Check the repository's workflows under /.github/workflows/ + schedule: + interval: daily + labels: + - "topic: infrastructure" diff --git a/.github/workflows/arduino-lint.yml b/.github/workflows/arduino-lint.yml new file mode 100644 index 0000000..bebb3cb --- /dev/null +++ b/.github/workflows/arduino-lint.yml @@ -0,0 +1,26 @@ +name: Arduino Lint +on: + push: + pull_request: + # Scheduled trigger checks for breakage caused by new rules added to Arduino Lint + schedule: + # run every Saturday at 3 AM UTC + - cron: "0 3 * * 6" + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Arduino Lint + uses: arduino/arduino-lint-action@v1 + with: + official: true + library-manager: update diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml new file mode 100644 index 0000000..bc922bf --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,104 @@ +name: Compile Examples + +on: + pull_request: + paths: + - ".github/workflows/compile-examples.yml" + - "library.properties" + - "examples/**" + - "src/**" + push: + paths: + - ".github/workflows/compile-examples.yml" + - "library.properties" + - "examples/**" + - "src/**" + # Scheduled trigger checks for breakage caused by changes to external resources (libraries, platforms) + schedule: + # run every Saturday at 3 AM UTC + - cron: "0 3 * * 6" + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + build: + name: ${{ matrix.board.fqbn }} + runs-on: ubuntu-latest + + env: + UNIVERSAL_SKETCH_PATHS: | + - examples/backlight/SimpleBacklight + - examples/basic/ArduinoLogoDrawing + - examples/basic/SimpleText + - examples/camera/display_camera + - examples/gfx/geometrical-shapes + - examples/gfx/hello-world + - examples/gfx/touch-switch + - examples/imu/accelerometer + - examples/imu/gyroscope + - examples/lvgl/bar_lvgl + - examples/lvgl/button_lvgl + - examples/lvgl/check_radio_lvgl + - examples/lvgl/image_lvgl + - examples/lvgl/imu_orientation + - examples/lvgl/slider_lvgl + - examples/microphone/PDMSerialPlotter + - examples/rgb/SimpleRGB + - examples/rgb/blink + + SKETCHES_REPORTS_PATH: sketches-reports + + strategy: + fail-fast: false + + matrix: + board: + - fqbn: arduino:mbed_portenta:envie_m7 + platform-name: arduino:mbed_portenta + - fqbn: arduino:mbed_giga:giga + platform-name: arduino:mbed_giga + + include: + - board: + platform-name: arduino:mbed_portenta + platforms: | + # Install Arduino mbed_portenta Boards via Boards Manager + - name: arduino:mbed_portenta + - board: + platform-name: arduino:mbed_giga + platforms: | + # Install Arduino mbed_giga Boards via Boards Manager + - name: arduino:mbed_giga + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Compile examples + uses: arduino/compile-sketches@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + platforms: ${{ matrix.platforms }} + fqbn: ${{ matrix.board.fqbn }} + libraries: | + # Install the library from the local path. + - source-path: ./ + - name: ArduinoGraphics + - name: Arduino_GigaDisplayTouch + - name: Arduino_BMI270_BMM150 + - name: Arduino_GigaDisplay_GFX + - name: lvgl + - name: Arducam_dvp + sketch-paths: | + ${{ env.UNIVERSAL_SKETCH_PATHS }} + enable-deltas-report: true + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} + + - name: Save memory usage change report as artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ env.SKETCHES_REPORTS_PATH }} + if-no-files-found: error + path: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..5b6e9a6 --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,24 @@ +name: Report Size Deltas + +on: + push: + paths: + - ".github/workflows/report-size-deltas.ya?ml" + schedule: + - cron: '*/5 * * * *' + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + + steps: + # See: https://github.com/arduino/actions/blob/master/libraries/report-size-deltas/README.md + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # The name of the workflow artifact created by the "Compile Examples" workflow + sketches-reports-source: sketches-reports diff --git a/.github/workflows/spell-check-task.yml b/.github/workflows/spell-check-task.yml deleted file mode 100644 index f4d5cfe..0000000 --- a/.github/workflows/spell-check-task.yml +++ /dev/null @@ -1,70 +0,0 @@ -# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md -name: Spell Check - -env: - # See: https://github.com/actions/setup-python/tree/main#available-versions-of-python - PYTHON_VERSION: "3.9" - -# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows -on: - create: - push: - pull_request: - schedule: - # Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates. - - cron: "0 8 * * TUE" - workflow_dispatch: - repository_dispatch: - -jobs: - run-determination: - runs-on: ubuntu-latest - permissions: {} - outputs: - result: ${{ steps.determination.outputs.result }} - steps: - - name: Determine if the rest of the workflow should run - id: determination - run: | - RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" - # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. - if [[ - "${{ github.event_name }}" != "create" || - "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX - ]]; then - # Run the other jobs. - RESULT="true" - else - # There is no need to run the other jobs. - RESULT="false" - fi - - echo "result=$RESULT" >> $GITHUB_OUTPUT - - spellcheck: - needs: run-determination - if: needs.run-determination.outputs.result == 'true' - runs-on: ubuntu-latest - permissions: - contents: read - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Install Poetry - run: pip install poetry - - - name: Install Task - uses: arduino/setup-task@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x - - - name: Spell check - run: task general:check-spelling diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..cd0de84 --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,24 @@ +name: Spell Check + +on: + pull_request: + push: + schedule: + # Run every Saturday at 3 AM UTC to catch new misspelling detections resulting from dictionary updates. + - cron: "0 3 * * 6" + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + spellcheck: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # See: https://github.com/codespell-project/actions-codespell/blob/master/README.md + - name: Spell check + uses: codespell-project/actions-codespell@v2 diff --git a/.github/workflows/sync-labels-npm.yml b/.github/workflows/sync-labels.yml similarity index 72% rename from .github/workflows/sync-labels-npm.yml rename to .github/workflows/sync-labels.yml index a6714cd..59ec78c 100644 --- a/.github/workflows/sync-labels-npm.yml +++ b/.github/workflows/sync-labels.yml @@ -1,47 +1,34 @@ -# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels-npm.md +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md name: Sync Labels -env: - # See: https://github.com/actions/setup-node/#readme - NODE_VERSION: 16.x - CONFIGURATIONS_FOLDER: .github/label-configuration-files - CONFIGURATIONS_ARTIFACT: label-configuration-files - -# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows on: push: paths: - - ".github/workflows/sync-labels-npm.ya?ml" + - ".github/workflows/sync-labels.ya?ml" - ".github/label-configuration-files/*.ya?ml" - - "package.json" - - "package-lock.json" pull_request: paths: - - ".github/workflows/sync-labels-npm.ya?ml" + - ".github/workflows/sync-labels.ya?ml" - ".github/label-configuration-files/*.ya?ml" - - "package.json" - - "package-lock.json" schedule: # Run daily at 8 AM UTC to sync with changes to shared label configurations. - cron: "0 8 * * *" workflow_dispatch: repository_dispatch: +env: + CONFIGURATIONS_FOLDER: .github/label-configuration-files + CONFIGURATIONS_ARTIFACT: label-configuration-files + jobs: check: runs-on: ubuntu-latest - permissions: - contents: read steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Download JSON schema for labels configuration file id: download-schema uses: carlosperate/download-file-action@v2 @@ -50,24 +37,24 @@ jobs: location: ${{ runner.temp }}/label-configuration-schema - name: Install JSON schema validator - run: npm install + run: | + sudo npm install \ + --global \ + ajv-cli \ + ajv-formats - name: Validate local labels configuration run: | # See: https://github.com/ajv-validator/ajv-cli#readme - npx \ - --package=ajv-cli \ - --package=ajv-formats \ - ajv validate \ - --all-errors \ - -c ajv-formats \ - -s "${{ steps.download-schema.outputs.file-path }}" \ - -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" + ajv validate \ + --all-errors \ + -c ajv-formats \ + -s "${{ steps.download-schema.outputs.file-path }}" \ + -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" download: needs: check runs-on: ubuntu-latest - permissions: {} strategy: matrix: @@ -94,14 +81,11 @@ jobs: sync: needs: download runs-on: ubuntu-latest - permissions: - contents: read - issues: write steps: - name: Set environment variables run: | - # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable + # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" - name: Determine whether to dry run @@ -134,11 +118,6 @@ jobs: with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Merge label configuration files run: | # Merge all configuration files @@ -146,15 +125,14 @@ jobs: cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" - name: Install github-label-sync - run: npm install + run: sudo npm install --global github-label-sync - name: Sync labels env: GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # See: https://github.com/Financial-Times/github-label-sync - npx \ - github-label-sync \ - --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ - ${{ steps.dry-run.outputs.flag }} \ - ${{ github.repository }} + github-label-sync \ + --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ + ${{ steps.dry-run.outputs.flag }} \ + ${{ github.repository }} diff --git a/README.md b/README.md index e7ecaf6..971b8a7 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ Arduino_GigaDisplay =================== -[![Spell Check status](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions/workflows/spell-check-task.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions/workflows/spell-check-task.yml) -[![Sync Labels status](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions/workflows/sync-labels-npm.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions/workflows/sync-labels-npm.yml) + +[![Compile Examples](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions?workflow=Compile+Examples) +[![Arduino Lint](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions?workflow=Arduino+Lint) +[![Spell Check](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_GigaDisplay/actions?workflow=Spell+Check) This library contains a set of examples to use the [GIGA Display Shield](docs.arduino.cc/hardware/giga-display-shield). Upon installing this library from the Arduino IDE, the following libraries will also be installed: - [ArduinoGraphics](https://github.com/arduino-libraries/ArduinoGraphics) - [Arduino_GigaDisplayTouch](https://github.com/arduino-libraries/Arduino_GigaDisplayTouch) - [Arduino_BMI270_BMM150](https://github.com/arduino-libraries/Arduino_BMI270_BMM150) - [Arduino_GigaDisplayGFX](https://github.com/arduino-libraries/Arduino_GigaDisplay_GFX) +- [Arducam_dvp](https://github.com/ArduCAM/Arducam_dvp) It will also install the [lvgl](https://github.com/lvgl/lvgl) library, which is required for a large number of examples in this repository. diff --git a/examples/camera/display_camera/display_camera.ino b/examples/camera/display_camera/display_camera.ino index d972d97..f3c9dbf 100644 --- a/examples/camera/display_camera/display_camera.ino +++ b/examples/camera/display_camera/display_camera.ino @@ -4,7 +4,7 @@ #include "dsi.h" #include "SDRAM.h" -// This example only works with Greyscale cameras (due to the palette + resize&rotate algo) +// This example only works with Grayscale cameras (due to the palette + resize&rotate algo) #define ARDUCAM_CAMERA_HM01B0 #ifdef ARDUCAM_CAMERA_HM01B0 @@ -58,7 +58,7 @@ void setup() { blinkLED(); } - // Setup the palette to convert 8 bit greyscale to 32bit greyscale + // Setup the palette to convert 8 bit grayscale to 32bit grayscale for (int i = 0; i < 256; i++) { palette[i] = 0xFF000000 | (i << 16) | (i << 8) | i; } diff --git a/library.properties b/library.properties index ccace4c..928c2ab 100644 --- a/library.properties +++ b/library.properties @@ -5,7 +5,7 @@ maintainer=Arduino sentence=Examples for GIGA Display Shield paragraph= category=Device Control -url=https://www.arduino.cc/ -architectures=mbed_giga +url=https://github.com/arduino-libraries/Arduino_GigaDisplay +architectures=mbed_giga,mbed_portenta includes=Arduino_GigaDisplay.h -depends=Arduino_BMI270_BMM150,Arduino_GigaDisplayTouch,ArduinoGraphics,Arduino_GigaDisplay_GFX,lvgl +depends=Arduino_BMI270_BMM150,Arduino_GigaDisplayTouch,ArduinoGraphics,Arduino_GigaDisplay_GFX,lvgl,Arducam_dvp \ No newline at end of file