Giter Site home page Giter Site logo

Comments (3)

witnessmenow avatar witnessmenow commented on August 26, 2024 1

Thank you @per1234 , much appreciated

from compile-sketches.

witnessmenow avatar witnessmenow commented on August 26, 2024

I am able to achieve it by building twice, but its a little wasteful!

# Fake Arduino Code
      - uses: arduino/compile-sketches@v1
        name: Fake Build to install libraries
        with: 
          fqbn: "esp32:esp32:esp32"
          platforms: |
            - name: esp32:esp32
              source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
          # No need to specify ESP-libraries as these are installed with the platform (on the line above). 
          # Downloading SpeedyStepper from source to get correct casing on import of Arduino.h (spelled arduino.h in the version from Arduino Libary Manager)
          libraries: | 
            - name: ImageFetcher
              source-url: https://github.com/witnessmenow/file-fetcher-arduino.git
            - name: WiFiManager
            - name: ESP_DoubleResetDetector 
            - name: ArduinoJson 
            - name: ezTime 
            - name: UniversalTelegramBot
            - name: TFT_eSPI
            - name: PNGdec
          sketch-paths: |
            - F1-Notifications
          enable-warnings-report: true
          verbose: true
          cli-compile-flags: |
            - --export-binaries

      # Copy binaries to GitHubPages folder for publishing
      - name: Copy User_Setup.h
        run: |
          \cp -fR DisplayConfig/User_Setup.h ~/Arduino/libraries/TFT_eSPI/

      # Build Arduino Code
      - uses: arduino/compile-sketches@v1
        name: Compile CYD code
        with: 
          fqbn: "esp32:esp32:esp32"
          platforms: |
            - name: esp32:esp32
              source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
          # No need to specify ESP-libraries as these are installed with the platform (on the line above). 
          # Downloading SpeedyStepper from source to get correct casing on import of Arduino.h (spelled arduino.h in the version from Arduino Library Manager)
          libraries: | 
            - name: ImageFetcher
              source-url: https://github.com/witnessmenow/file-fetcher-arduino.git
          sketch-paths: |
            - F1-Notifications
          enable-warnings-report: true
          verbose: true
          cli-compile-flags: |
            - --export-binaries

from compile-sketches.

per1234 avatar per1234 commented on August 26, 2024

Hi @witnessmenow. The compilation runs in the same environment as the rest of your workflow job, so you can prepare the environment as needed in advance. This means that if you need to make any modifications to dependencies, simply run those operations in workflow steps before the step that executes the arduino/compile-sketches action.

Although you could do it various ways, if you want to install the latest release version of the TFT_eSPI library in preparation for injecting your customizations into it, an arduino-cli lib install command is probably the most convenient approach. Arduino provides another action named arduino/setup-arduino-cli that simply installs Arduino CLI into the runner environment, after which you can use it in arbitrary shell commands. So you can do something like this:

      - name: Install Arduino CLI
        uses: arduino/setup-arduino-cli@v1

      - name: Install TFT_eSPI library to prepare for modifications
        run: |
          arduino-cli lib install TFT_eSPI

      - name: Copy User_Setup.h
        run: |
          cp -fR DisplayConfig/User_Setup.h ~/Arduino/libraries/TFT_eSPI/

      - uses: arduino/compile-sketches@v1
        name: Compile CYD code
        with: 
          fqbn: "esp32:esp32:esp32"
          platforms: |
            - name: esp32:esp32
              source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
          # No need to specify ESP-libraries as these are installed with the platform (on the line above). 
          libraries: | 
            - name: ImageFetcher
              source-url: https://github.com/witnessmenow/file-fetcher-arduino.git
            - name: WiFiManager
            - name: ESP_DoubleResetDetector 
            - name: ArduinoJson 
            - name: ezTime 
            - name: UniversalTelegramBot
            - name: PNGdec
          sketch-paths: |
            - F1-Notifications
          enable-warnings-report: true
          verbose: true
          cli-compile-flags: |
            - --export-binaries

Note that I did not include TFT_eSPI in the libraries input of the arduino/compile-sketches step because it had already been installed by the prior step.

If you have any questions or problems while using Arduino's GitHub Actions actions, or with setting up continuous integration of Arduino projects in general, you are welcome to post over on Arduino Forum. I'll be happy to provide assistance over there.

from compile-sketches.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.