Skip to content

Add an integration test CI workflow #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Run integration tests

on:
pull_request:
paths:
- '.github/workflows/test-integration.yml'
- '.github/workflows/testdata'
- 'action.yml'
- 'compilesketches/**'

push:
paths:
- '.github/workflows/test-integration.yml'
- '.github/workflows/testdata'
- 'action.yml'
- 'compilesketches/**'

env:
SKETCHES_REPORTS_PATH: sketches-reports
TESTDATA_SKETCHES_PATH: .github/workflows/testdata/sketches

jobs:
default-inputs:
runs-on: ubuntu-latest

steps:
- name: Checkout Servo library
uses: actions/checkout@v2
with:
repository: arduino-libraries/servo
ref: 1.1.7

- name: Checkout local repo
uses: actions/checkout@v2
with:
# Must be checked out to a subfolder to not interfere with the checked out library under test
path: extras/compile-sketches

- name: Run action with default input values
# Use action from local path
uses: ./extras/compile-sketches


all-inputs:
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
board:
- fqbn: arduino:avr:uno
platforms: |
- name: arduino:avr
version: 1.8.3
libraries: |
- name: Servo
version: 1.1.7
# Board that requires Boards Manager URL
- fqbn: esp8266:esp8266:huzzah
platforms: |
- name: esp8266:esp8266
source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
version: 2.7.4
libraries: |
# The official Servo library is not compatible with ESP8266, but that platform has a bundled Servo lib
# so there are no library dependencies
-

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run action
# Use action from local path
uses: ./
with:
cli-version: 0.13.0
platforms: ${{ matrix.board.platforms }}
fqbn: ${{ matrix.board.fqbn }}
libraries: ${{ matrix.board.libraries }}
sketch-paths: |
- ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum
- ${{ env.TESTDATA_SKETCHES_PATH }}/ServoLibrary
enable-deltas-report: true
enable-warnings-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
verbose: true


expected-failed-compilation:
runs-on: ubuntu-latest

steps:
- name: Checkout local repo
uses: actions/checkout@v2

- name: Compile sketch that is expected to error
id: compile-sketches
continue-on-error: true
uses: ./
with:
fqbn: arduino:avr:uno
libraries: |
-
sketch-paths: |
- ${{ env.TESTDATA_SKETCHES_PATH }}/Error

- name: Fail the job if the action run succeeded
if: steps.compile-sketches.outcome == 'success'
run: |
echo "::error::The action run was expected to fail, but passed!"
exit 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
void setup() {}
void loop() {}
1 change: 1 addition & 0 deletions .github/workflows/testdata/sketches/Error/Error.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#error
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <Servo.h>
void setup() {}
void loop() {}