From a45684cb5f89d9629137531d7234765034c5936a Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 20:57:31 -0800 Subject: [PATCH 01/13] Attempt to get 4 CI configs working --- .circleci/config.yml | 18 ++++++++++++++++++ .github/workflows/Arduino-CI.yaml | 15 +++++++++++++++ appveyor.yml | 4 ++++ 3 files changed, 37 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 .github/workflows/Arduino-CI.yaml create mode 100644 appveyor.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..3f4c372 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,18 @@ +version: 2.1 + +jobs: + arduino-ci-test: + docker: + - image: circleci/ruby:2.6 + steps: + - checkout + - run: + name: Install and test + command: | + bundle install + bundle exec arduino_ci_remote.rb + +workflows: + arduino-ci-workflow: + jobs: + - arduino-ci-test diff --git a/.github/workflows/Arduino-CI.yaml b/.github/workflows/Arduino-CI.yaml new file mode 100644 index 0000000..519fffe --- /dev/null +++ b/.github/workflows/Arduino-CI.yaml @@ -0,0 +1,15 @@ +name: Arduino CI + +on: [push, pull_request] + +jobs: + runTest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + - run: | + bundle install + bundle exec arduino_ci_remote.rb diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..053f3bc --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,4 @@ +build: off +test_script: + - bundle install + - bundle exec arduino_ci.rb From 468a2c3d0f7c03a61eb2fee7041d6821a9729849 Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 21:04:52 -0800 Subject: [PATCH 02/13] Fixing url in properties --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 8f8a3e1..0a62dfa 100644 --- a/library.properties +++ b/library.properties @@ -5,6 +5,6 @@ maintainer=James Foster sentence=Sample Arduino library for use with arduino_ci paragraph=Sample Arduino library for use with arduino_ci category=Other -url=https://github.com/jgfoster/Blink +url=https://github.com/Arduino-CI/Blink architectures=avr includes=Blink.h From f0d05509109e5f59e3469738ae253e3d7b456d43 Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 21:23:40 -0800 Subject: [PATCH 03/13] Adding a note in the README --- appveyor.yml => .appveyor.yml | 0 .circleci/config.yml | 7 ------- README.md | 10 ++++++++++ 3 files changed, 10 insertions(+), 7 deletions(-) rename appveyor.yml => .appveyor.yml (100%) diff --git a/appveyor.yml b/.appveyor.yml similarity index 100% rename from appveyor.yml rename to .appveyor.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f4c372..333d799 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,3 @@ -version: 2.1 - jobs: arduino-ci-test: docker: @@ -11,8 +9,3 @@ jobs: command: | bundle install bundle exec arduino_ci_remote.rb - -workflows: - arduino-ci-workflow: - jobs: - - arduino-ci-test diff --git a/README.md b/README.md index c0b0cd5..931b72b 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,16 @@ To actually see this work, do the following: With that you should have an application that works and has automated tests. +### Example CI Configs + +In this repo, the Arduino-CI is used to run the test suite through several CI vendors. +The example code for each vendor is found in the following files: + +* AppVeyor - `.appveyor.yml` +* Circle CI - `.circleci/config.yml` +* GitHub Actions - `.github/workflows/Arduino-CI.yaml` +* Travis CI - `.travis.yml` + ## Credits This Arduino example was created in September 2020 by James Foster . From b5e0dd190cee63e729da64266f648e030d60f445 Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 21:24:38 -0800 Subject: [PATCH 04/13] Must have workflows in circle config --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 333d799..3f4c372 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,5 @@ +version: 2.1 + jobs: arduino-ci-test: docker: @@ -9,3 +11,8 @@ jobs: command: | bundle install bundle exec arduino_ci_remote.rb + +workflows: + arduino-ci-workflow: + jobs: + - arduino-ci-test From 93c363ae2739a2e1a34ade4216abca780397c3fb Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 21:47:16 -0800 Subject: [PATCH 05/13] Adding more the AppVeyor config --- .appveyor.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index 053f3bc..5eb4ff7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,15 @@ +install: + - set PATH=C:\Ruby22\bin;%PATH% + - bundle install + build: off + +before_test: + - ruby -v + - gem -v + - bundle -v + - g++ -v + test_script: - bundle install - bundle exec arduino_ci.rb From 62cb3dfd7a3748970098acdcbaf5727d48446764 Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 21:49:52 -0800 Subject: [PATCH 06/13] Ruby 2.6 for AppVeyor --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5eb4ff7..3d66911 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,5 +1,5 @@ install: - - set PATH=C:\Ruby22\bin;%PATH% + - set PATH=C:\Ruby26\bin;%PATH% - bundle install build: off From 3a33a0a8f7b27e0b4da25ed91aff58d48a28207f Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 21:50:49 -0800 Subject: [PATCH 07/13] Update AppVeyor config --- .appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 3d66911..94996f3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -8,7 +8,6 @@ before_test: - ruby -v - gem -v - bundle -v - - g++ -v test_script: - bundle install From 8308e767cbd385a6bce061d0c97bea472f55e8a0 Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 21:52:00 -0800 Subject: [PATCH 08/13] Update AppVeyor config --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 94996f3..322cfd2 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,4 +11,4 @@ before_test: test_script: - bundle install - - bundle exec arduino_ci.rb + - bundle exec arduino_ci_remote.rb From e8842a19a5f4896b08111140909c73ba818aa59b Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 21:54:44 -0800 Subject: [PATCH 09/13] Update AppVeyor config --- .appveyor.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 322cfd2..84d88d1 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,6 +1,12 @@ install: - - set PATH=C:\Ruby26\bin;%PATH% + - set PATH=C:\Ruby26\bin;C:\cygwin\bin;C:\cygwin64\bin;%PATH% - bundle install + - '%CYG_ROOT%\setup-%CYG_ARCH%.exe -qnNdO -R %CYG_ROOT% -s http://cygwin.mirror.constant.com -l %CYG_ROOT%/var/cache/setup -P autoconf -P automake -P bison -P libgmp-devel -P gcc-core -P gcc-g++ -P mingw-runtime -P mingw-binutils -P mingw-gcc-core -P mingw-gcc-g++ -P mingw-pthreads -P mingw-w32api -P libtool -P make -P gettext-devel -P gettext -P intltool -P libiconv -P pkg-config -P git -P wget -P curl' + +environment: + matrix: + - CYG_ARCH: x86_64 + CYG_ROOT: C:/cygwin64 build: off @@ -8,6 +14,7 @@ before_test: - ruby -v - gem -v - bundle -v + - g++ -v test_script: - bundle install From e123825dd17e6201ed3dbdf34672147e91b5f87d Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 22:35:26 -0800 Subject: [PATCH 10/13] Multiple OS in GitHub Actions. --- .github/workflows/Arduino-CI.yaml | 5 ++++- README.md | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Arduino-CI.yaml b/.github/workflows/Arduino-CI.yaml index 519fffe..43e2503 100644 --- a/.github/workflows/Arduino-CI.yaml +++ b/.github/workflows/Arduino-CI.yaml @@ -4,7 +4,10 @@ on: [push, pull_request] jobs: runTest: - runs-on: ubuntu-latest + strategy: + matrix: + os: [windows, ubuntu, macos] + runs-on: ${{ matrix.os }}-latest steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 diff --git a/README.md b/README.md index 931b72b..b6fe647 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,15 @@ You can watch a [video](https://youtu.be/vaS4AU_PXQo) showing how this project c Any serious software project should have good tests and much work has been done to automate that process. One challenging area for testing is low-level devices, such as an [Arduino](https://www.arduino.cc/), whose primary action is setting lines to high or low voltage. One project that seems to be doing a good job of filling this gap is [arduino_ci](https://github.com/ianfixes/arduino_ci). In this project we provide a sample Arduino program with automated tests. +   | Linux | macOS | Windows +-------------------|:------|:------|:-------- +**AppVeyor** | | | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/2m0y9wsawprq3i3p?svg=true)](https://ci.appveyor.com/project/prestoncarman/blink) +**CircleCI** | [![Linux Build Status](https://circleci.com/gh/prestoncarman/Blink/tree/2020-11-10_ci.svg?style=svg)](https://app.circleci.com/pipelines/github/prestoncarman/Blink) + | | +**GitHub Actions** | ![Linux Build Status](https://github.com/prestoncarman/Blink/workflows/Arduino%20CI/badge.svg) | ![Linux Build Status](https://github.com/prestoncarman/Blink/workflows/Arduino%20CI/badge.svg) | ![Linux Build Status](https://github.com/prestoncarman/Blink/workflows/Arduino%20CI/badge.svg) +**Travis CI** | [![Linux Build Status](https://ci.appveyor.com/api/projects/status/2m0y9wsawprq3i3p?svg=true)](https://ci.appveyor.com/project/prestoncarman/blink) | | + + ## Blink One of the initial Arduino tutorials is [Blink](https://www.arduino.cc/en/Tutorial/Blink), a program that simply turns an LED on and off for one second each. It is a nice demo that doesn't require any external devices and can be written in a few lines of code. From 96e1d1a1df45cd43de1fa239d44ff0e87b0db1da Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 22:43:01 -0800 Subject: [PATCH 11/13] Separate github actions os configs --- .github/workflows/{Arduino-CI.yaml => macos.yaml} | 7 +------ .github/workflows/ubuntu.yaml | 13 +++++++++++++ .github/workflows/windows.yaml | 13 +++++++++++++ README.md | 2 +- 4 files changed, 28 insertions(+), 7 deletions(-) rename .github/workflows/{Arduino-CI.yaml => macos.yaml} (67%) create mode 100644 .github/workflows/ubuntu.yaml create mode 100644 .github/workflows/windows.yaml diff --git a/.github/workflows/Arduino-CI.yaml b/.github/workflows/macos.yaml similarity index 67% rename from .github/workflows/Arduino-CI.yaml rename to .github/workflows/macos.yaml index 43e2503..900d2bc 100644 --- a/.github/workflows/Arduino-CI.yaml +++ b/.github/workflows/macos.yaml @@ -1,13 +1,8 @@ -name: Arduino CI - on: [push, pull_request] jobs: runTest: - strategy: - matrix: - os: [windows, ubuntu, macos] - runs-on: ${{ matrix.os }}-latest + runs-on: macos-latest steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml new file mode 100644 index 0000000..2c7e798 --- /dev/null +++ b/.github/workflows/ubuntu.yaml @@ -0,0 +1,13 @@ +on: [push, pull_request] + +jobs: + runTest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + - run: | + bundle install + bundle exec arduino_ci_remote.rb diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml new file mode 100644 index 0000000..c754168 --- /dev/null +++ b/.github/workflows/windows.yaml @@ -0,0 +1,13 @@ +on: [push, pull_request] + +jobs: + runTest: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + - run: | + bundle install + bundle exec arduino_ci_remote.rb diff --git a/README.md b/README.md index b6fe647..ba2ca4e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Any serious software project should have good tests and much work has been done **AppVeyor** | | | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/2m0y9wsawprq3i3p?svg=true)](https://ci.appveyor.com/project/prestoncarman/blink) **CircleCI** | [![Linux Build Status](https://circleci.com/gh/prestoncarman/Blink/tree/2020-11-10_ci.svg?style=svg)](https://app.circleci.com/pipelines/github/prestoncarman/Blink) | | -**GitHub Actions** | ![Linux Build Status](https://github.com/prestoncarman/Blink/workflows/Arduino%20CI/badge.svg) | ![Linux Build Status](https://github.com/prestoncarman/Blink/workflows/Arduino%20CI/badge.svg) | ![Linux Build Status](https://github.com/prestoncarman/Blink/workflows/Arduino%20CI/badge.svg) +**GitHub Actions** | ![Linux Build Status](https://github.com/prestoncarman/Blink/workflows/ubuntu/badge.svg) | ![macOS Build Status](https://github.com/prestoncarman/Blink/workflows/macos/badge.svg) | ![Windows Build Status](https://github.com/prestoncarman/Blink/workflows/windows/badge.svg) **Travis CI** | [![Linux Build Status](https://ci.appveyor.com/api/projects/status/2m0y9wsawprq3i3p?svg=true)](https://ci.appveyor.com/project/prestoncarman/blink) | | From c4d707873d145b0c3e458d9cc1904511fd936352 Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 22:45:21 -0800 Subject: [PATCH 12/13] Adding names for github actions os configs --- .github/workflows/macos.yaml | 2 ++ .github/workflows/ubuntu.yaml | 2 ++ .github/workflows/windows.yaml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 900d2bc..9212e52 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -1,3 +1,5 @@ +name: macos + on: [push, pull_request] jobs: diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml index 2c7e798..6bbb533 100644 --- a/.github/workflows/ubuntu.yaml +++ b/.github/workflows/ubuntu.yaml @@ -1,3 +1,5 @@ +name: ubuntu + on: [push, pull_request] jobs: diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index c754168..0f134ff 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -1,3 +1,5 @@ +name: windows + on: [push, pull_request] jobs: From f876763a9937e36bb5818f90d4471d77072b7dc4 Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Tue, 10 Nov 2020 22:46:36 -0800 Subject: [PATCH 13/13] fix format in readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index ba2ca4e..854ef7d 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ Any serious software project should have good tests and much work has been done   | Linux | macOS | Windows -------------------|:------|:------|:-------- **AppVeyor** | | | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/2m0y9wsawprq3i3p?svg=true)](https://ci.appveyor.com/project/prestoncarman/blink) -**CircleCI** | [![Linux Build Status](https://circleci.com/gh/prestoncarman/Blink/tree/2020-11-10_ci.svg?style=svg)](https://app.circleci.com/pipelines/github/prestoncarman/Blink) - | | +**CircleCI** | [![Linux Build Status](https://circleci.com/gh/prestoncarman/Blink/tree/2020-11-10_ci.svg?style=svg)](https://app.circleci.com/pipelines/github/prestoncarman/Blink) | | **GitHub Actions** | ![Linux Build Status](https://github.com/prestoncarman/Blink/workflows/ubuntu/badge.svg) | ![macOS Build Status](https://github.com/prestoncarman/Blink/workflows/macos/badge.svg) | ![Windows Build Status](https://github.com/prestoncarman/Blink/workflows/windows/badge.svg) **Travis CI** | [![Linux Build Status](https://ci.appveyor.com/api/projects/status/2m0y9wsawprq3i3p?svg=true)](https://ci.appveyor.com/project/prestoncarman/blink) | |