|
| 1 | +# This is the name of the workflow, visible on GitHub UI. |
| 2 | +name: compileTest |
| 3 | + |
| 4 | +# Here we tell GitHub to run the workflow when a commit |
| 5 | +# is pushed or a Pull Request is opened. |
| 6 | +on: push |
| 7 | + |
| 8 | +env: |
| 9 | + INSTALL_PLATFORMS: avr,ATTinyCore,digistump |
| 10 | + |
| 11 | +# This is the list of jobs that will be run concurrently. |
| 12 | +# Since we use a build matrix, the actual number of jobs |
| 13 | +# started depends on how many configurations the matrix |
| 14 | +# will produce. |
| 15 | +jobs: |
| 16 | + # This is the name of the job - can be whatever. |
| 17 | + compileTest-matrix: |
| 18 | + name: Test compiling all examples |
| 19 | + |
| 20 | + # Here we tell GitHub that the jobs must be determined |
| 21 | + # dynamically depending on a matrix configuration. |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + # The matrix will produce one job for each configuration |
| 25 | + # parameter of type `arduino-platform`, in this case a |
| 26 | + # total of 2. |
| 27 | + #arduino-platform: ["arduino:samd", "arduino:avr"] |
| 28 | + arduino-platform: "arduino:avr" |
| 29 | + # This is usually optional but we need to statically define the |
| 30 | + # FQBN of the boards we want to test for each platform. In the |
| 31 | + # future the CLI might automatically detect and download the core |
| 32 | + # needed to compile against a certain FQBN, at that point the |
| 33 | + # following `include` section will be useless. |
| 34 | + include: |
| 35 | + # This works like this: when the platformn is "arduino:samd", the |
| 36 | + # variable `fqbn` is set to "arduino:samd:nano_33_iot". |
| 37 | + #- arduino-platform: "arduino:samd" |
| 38 | + # fqbn: "arduino:samd:nano_33_iot" |
| 39 | + - arduino-platform: "arduino:avr" |
| 40 | + fqbn: "arduino:avr:uno" |
| 41 | + |
| 42 | + # This is the platform GitHub will use to run our workflow, we |
| 43 | + # pick Windows for no particular reason. |
| 44 | + runs-on: windows-latest |
| 45 | + |
| 46 | + # This is the list of steps this job will run. |
| 47 | + steps: |
| 48 | + # First of all, we clone the repo using the `checkout` action. |
| 49 | + - name: Checkout |
| 50 | + uses: actions/checkout@master |
| 51 | + |
| 52 | + # We use the `arduino/setup-arduino-cli` action to install and |
| 53 | + # configure the Arduino CLI on the system. |
| 54 | + - name: Setup Arduino CLI |
| 55 | + uses: arduino/setup-arduino-cli@v1.0.0 |
| 56 | + |
| 57 | + # Error check |
| 58 | + - name: Check for error |
| 59 | + if: failure() |
| 60 | + run: echo Failure on Setup Arduino CLI |
| 61 | + |
| 62 | + # We then install the platform, which one will be determined |
| 63 | + # dynamically by the build matrix. |
| 64 | + - name: Install platform |
| 65 | + run: | |
| 66 | + arduino-cli core update-index |
| 67 | + arduino-cli core install ${{ matrix.arduino-platform }} |
| 68 | + |
| 69 | + # Finally, we compile the sketch, using the FQBN that was set |
| 70 | + # in the build matrix. |
| 71 | + - name: Compile Sketch |
| 72 | + run: arduino-cli compile --fqbn ${{ matrix.fqbn }} ./SimpleFrequencyDetector |
0 commit comments