From a6cfb2486b8bb84d9a592ad4f1b8d3e4a220febd Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Sun, 15 Nov 2020 20:46:24 -0800 Subject: [PATCH 1/6] Adding automated test on based on macOS Catalina 10.15 --- .github/workflows/macos.yaml | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/macos.yaml diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml new file mode 100644 index 00000000..b827d8fe --- /dev/null +++ b/.github/workflows/macos.yaml @@ -0,0 +1,58 @@ +# This is the name of the workflow, visible on GitHub UI +name: macos + +# Run on a Push or a Pull Request +on: [push, pull_request] + +jobs: + rubocop: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for rubocop + - name: Build and Execute + run: | + g++ -v + bundle install + bundle exec rubocop --version + bundle exec rubocop -D . + bundle exec rspec --backtrace + + TestSomething: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for TestSomething + - name: Build and Execute + run: | + g++ -v + bundle install + cd SampleProjects/TestSomething + bundle install + bundle exec arduino_ci.rb + + NetworkLib: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for NetworkLib + - name: Build and Execute + run: | + g++ -v + bundle install + cd SampleProjects/NetworkLib + ./scripts/install.sh + bundle install + bundle exec arduino_ci.rb From bd397f0869eca1b7278576d43def80df3af4c5cd Mon Sep 17 00:00:00 2001 From: Ian Katz Date: Sat, 28 Nov 2020 16:13:38 -0500 Subject: [PATCH 2/6] Add changelog entry for macos github action --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63ccb39f..bb6b77f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Code coverage tooling - Explicit check and warning for library directory names that do not match our guess of what the library should/would be called - Symlink tests for `Host` +- GitHub action for MacOS ### Changed - Arduino backend is now `arduino-cli` version `0.13.0` From 6bad2f075901f8144827e840ec16a88019557740 Mon Sep 17 00:00:00 2001 From: Ian Katz Date: Sat, 28 Nov 2020 16:03:42 -0500 Subject: [PATCH 3/6] Fix builtin-platform logic, by removing it entirely --- CHANGELOG.md | 1 + exe/arduino_ci.rb | 13 +++---------- lib/arduino_ci/ci_config.rb | 7 ------- misc/default.yml | 8 ++++++-- spec/ci_config_spec.rb | 3 --- 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb6b77f0..3a436f6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed - `ARDUINO_CI_SKIP_SPLASH_SCREEN_RSPEC_TESTS` no longer affects any tests because there are no longer splash screens since switching to `arduino-cli` +- `CIConfig.package_builtin?` as this is no longer relevant to the `arduino-cli` backend (which has no built-in packages) ### Fixed - Mismatches between library names in `library.properties` and the directory names, which can cause cryptic failures diff --git a/exe/arduino_ci.rb b/exe/arduino_ci.rb index bb8dcfb1..c07faf8c 100755 --- a/exe/arduino_ci.rb +++ b/exe/arduino_ci.rb @@ -310,21 +310,14 @@ def perform_example_compilation_tests(cpp_library, config) # do that, set the URLs, and download the packages all_packages = example_platform_info.values.map { |v| v[:package] }.uniq.reject(&:nil?) - builtin_packages, external_packages = all_packages.partition { |p| config.package_builtin?(p) } - - # inform about builtin packages - builtin_packages.each do |p| - inform("Using built-in board package") { p } - end - # make sure any non-builtin package has a URL defined - external_packages.each do |p| + all_packages.each do |p| assure("Board package #{p} has a defined URL") { board_package_url[p] } end # set up all the board manager URLs. # we can safely reject nils now, they would be for the builtins - all_urls = external_packages.map { |p| board_package_url[p] }.uniq.reject(&:nil?) + all_urls = all_packages.map { |p| board_package_url[p] }.uniq.reject(&:nil?) unless all_urls.empty? assure("Setting board manager URLs") do @@ -332,7 +325,7 @@ def perform_example_compilation_tests(cpp_library, config) end end - external_packages.each do |p| + all_packages.each do |p| assure("Installing board package #{p}") do @backend.install_boards(p) end diff --git a/lib/arduino_ci/ci_config.rb b/lib/arduino_ci/ci_config.rb index 5f77b7bd..315f770b 100644 --- a/lib/arduino_ci/ci_config.rb +++ b/lib/arduino_ci/ci_config.rb @@ -232,13 +232,6 @@ def platform_definition(platform_name) deep_clone(defn) end - # Whether a package is built-in to arduino - # @param package [String] the package name (e.g. "arduino:avr") - # @return [bool] - def package_builtin?(package) - package.start_with?("arduino:") - end - # the URL that gives the download info for a given package (a JSON file). # this is NOT where the package comes from. # @param package [String] the package name (e.g. "arduino:avr") diff --git a/misc/default.yml b/misc/default.yml index 1bef2e27..4d621a79 100644 --- a/misc/default.yml +++ b/misc/default.yml @@ -3,8 +3,12 @@ # https://en.wikipedia.org/wiki/List_of_Arduino_boards_and_compatible_systems packages: - # arduino:xxx are builtin, we don't need to include them here - # but if we did, it would be url: https://downloads.arduino.cc/packages/package_index.json + arduino:avr: + url: https://downloads.arduino.cc/packages/package_index.json + arduino:sam: + url: https://downloads.arduino.cc/packages/package_index.json + arduino:samd: + url: https://downloads.arduino.cc/packages/package_index.json esp8266:esp8266: url: http://arduino.esp8266.com/stable/package_esp8266com_index.json adafruit:avr: diff --git a/spec/ci_config_spec.rb b/spec/ci_config_spec.rb index 8ae3431a..a0d53bde 100644 --- a/spec/ci_config_spec.rb +++ b/spec/ci_config_spec.rb @@ -27,9 +27,6 @@ expect(zero[:package]).to eq("arduino:samd") expect(zero[:gcc].class).to eq(Hash) - expect(default_config.package_builtin?("arduino:avr")).to be true - expect(default_config.package_builtin?("adafruit:avr")).to be false - expect(default_config.package_url("adafruit:avr")).to eq("https://adafruit.github.io/arduino-board-index/package_adafruit_index.json") expect(default_config.package_url("adafruit:samd")).to eq("https://adafruit.github.io/arduino-board-index/package_adafruit_index.json") expect(default_config.package_url("esp32:esp32")).to eq("https://dl.espressif.com/dl/package_esp32_index.json") From 62d29f5daea36a6392be6bdf572989e2a3b50889 Mon Sep 17 00:00:00 2001 From: Ian Katz Date: Sat, 28 Nov 2020 16:38:58 -0500 Subject: [PATCH 4/6] Fix workflow action --- .github/workflows/macos.yaml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index b827d8fe..7dfcc2b6 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -5,29 +5,42 @@ name: macos on: [push, pull_request] jobs: - rubocop: + rspec: runs-on: macos-latest steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 - with: + with: ruby-version: 2.6 # Install and run Arduino CI tests for rubocop - name: Build and Execute run: | g++ -v + bundle install + bundle exec rspec --backtrace + + rubocop: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for rubocop + - name: Build and Execute + run: | bundle install bundle exec rubocop --version bundle exec rubocop -D . - bundle exec rspec --backtrace - TestSomething: + TestSomething: runs-on: macos-latest steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 - with: + with: ruby-version: 2.6 # Install and run Arduino CI tests for TestSomething @@ -39,12 +52,12 @@ jobs: bundle install bundle exec arduino_ci.rb - NetworkLib: + NetworkLib: runs-on: macos-latest steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 - with: + with: ruby-version: 2.6 # Install and run Arduino CI tests for NetworkLib @@ -53,6 +66,6 @@ jobs: g++ -v bundle install cd SampleProjects/NetworkLib - ./scripts/install.sh + sh ./scripts/install.sh bundle install bundle exec arduino_ci.rb From be8b108706ad2e1d5b5a143889051e7cecba5a3d Mon Sep 17 00:00:00 2001 From: Preston Carman Date: Sat, 28 Nov 2020 21:13:18 -0500 Subject: [PATCH 5/6] Creating a GitHub Action to run automated tests (squashed) --- .github/workflows/linux.yaml | 58 ++++++++++++++++++++ .github/workflows/windows.yaml | 58 ++++++++++++++++++++ CHANGELOG.md | 2 + README.md | 32 +++++++++-- SampleProjects/NetworkLib/scripts/install.sh | 2 +- 5 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/linux.yaml create mode 100644 .github/workflows/windows.yaml diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml new file mode 100644 index 00000000..c89ed912 --- /dev/null +++ b/.github/workflows/linux.yaml @@ -0,0 +1,58 @@ +# This is the name of the workflow, visible on GitHub UI +name: linux + +# Run on a Push or a Pull Request +on: [push, pull_request] + +jobs: + rubocop: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for rubocop + - name: Build and Execute + run: | + g++ -v + bundle install + bundle exec rubocop --version + bundle exec rubocop -D . + bundle exec rspec --backtrace + + TestSomething: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for TestSomething + - name: Build and Execute + run: | + g++ -v + bundle install + cd SampleProjects/TestSomething + bundle install + bundle exec arduino_ci.rb + + NetworkLib: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for NetworkLib + - name: Build and Execute + run: | + g++ -v + bundle install + cd SampleProjects/NetworkLib + ./scripts/install.sh + bundle install + bundle exec arduino_ci.rb diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml new file mode 100644 index 00000000..59a5501b --- /dev/null +++ b/.github/workflows/windows.yaml @@ -0,0 +1,58 @@ +# This is the name of the workflow, visible on GitHub UI +name: windows + +# Run on a Push or a Pull Request +on: [push, pull_request] + +jobs: + rubocop: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for rubocop + - name: Build and Execute + run: | + g++ -v + bundle install + bundle exec rubocop --version + bundle exec rubocop -D . + bundle exec rspec --backtrace + + TestSomething: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for TestSomething + - name: Build and Execute + run: | + g++ -v + bundle install + cd SampleProjects/TestSomething + bundle install + bundle exec arduino_ci.rb + + NetworkLib: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for Network + - name: Build and Execute + run: | + g++ -v + bundle install + cd SampleProjects/NetworkLib + bash -x ./scripts/install.sh + bundle install + bundle exec arduino_ci.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a436f6c..bad6404c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Explicit check and warning for library directory names that do not match our guess of what the library should/would be called - Symlink tests for `Host` - GitHub action for MacOS +- Add documentation on how to use Arduino CI with GitHub Actions +- Allow tests to run on GitHub without external set up with GitHub Actions (for Windows and Ubuntu) ### Changed - Arduino backend is now `arduino-cli` version `0.13.0` diff --git a/README.md b/README.md index c97ed550..57dc3e0a 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ You want your Arduino library to be automatically built and tested every time so `arduino_ci` is a cross-platform build/test system, consisting of a Ruby gem and a series of C++ mocks. It enables tests to be run both locally and as part of a CI service like Travis or Appveyor. Any OS that can run the Arduino IDE can run `arduino_ci`. -Platform | CI Status ----------|:--------- -OSX | [![OSX Build Status](http://badges.herokuapp.com/travis/Arduino-CI/arduino_ci?env=BADGE=osx&label=build&branch=master)](https://travis-ci.org/Arduino-CI/arduino_ci) -Linux | [![Linux Build Status](http://badges.herokuapp.com/travis/Arduino-CI/arduino_ci?env=BADGE=linux&label=build&branch=master)](https://travis-ci.org/Arduino-CI/arduino_ci) -Windows | [![Windows Build status](https://ci.appveyor.com/api/projects/status/abynv8xd75m26qo9/branch/master?svg=true)](https://ci.appveyor.com/project/ianfixes/arduino-ci) +   | Linux | macOS | Windows +-------------------|:------|:------|:-------- +**AppVeyor** | | | [![Windows Build status](https://ci.appveyor.com/api/projects/status/abynv8xd75m26qo9/branch/master?svg=true)](https://ci.appveyor.com/project/ianfixes/arduino-ci) +**GitHub Actions** | [![Arduino CI](https://github.com/Arduino-CI/arduino_ci/workflows/linux/badge.svg)](https://github.com/Arduino-CI/arduino_ci/actions?workflow=linux) | | [![Arduino CI](https://github.com/Arduino-CI/arduino_ci/workflows/windows/badge.svg)](https://github.com/Arduino-CI/arduino_ci/actions?workflow=windows) +**Travis CI** | [![Linux Build Status](http://badges.herokuapp.com/travis/Arduino-CI/arduino_ci?env=BADGE=linux&label=build&branch=master)](https://travis-ci.org/Arduino-CI/arduino_ci) | [![OSX Build Status](http://badges.herokuapp.com/travis/Arduino-CI/arduino_ci?env=BADGE=osx&label=build&branch=master)](https://travis-ci.org/Arduino-CI/arduino_ci) | ## Comparison to Other Arduino Testing Tools @@ -158,6 +158,28 @@ test_script: - bundle exec arduino_ci.rb ``` +#### GitHub Actions + +GitHub Actions allows you to automate your workflows directly in GitHub. +No additional steps are needed. +Just create a YAML file with the information below in your repo under the `.github/workflows/` directory. + +```yaml +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 +``` + + ## Known Problems * The Arduino library is not fully mocked. diff --git a/SampleProjects/NetworkLib/scripts/install.sh b/SampleProjects/NetworkLib/scripts/install.sh index b4e2dd40..54b8d4e0 100644 --- a/SampleProjects/NetworkLib/scripts/install.sh +++ b/SampleProjects/NetworkLib/scripts/install.sh @@ -4,5 +4,5 @@ # then get the custom one we want to use for testing cd $(bundle exec arduino_library_location.rb) if [ ! -d ./Ethernet ] ; then - git clone https://github.com/Arduino-CI/Ethernet.git + git clone --depth 1 https://github.com/Arduino-CI/Ethernet.git fi From 1b95f4cea8003e14b3c8176afab222d1505d01dd Mon Sep 17 00:00:00 2001 From: Ian Katz Date: Sat, 28 Nov 2020 21:20:11 -0500 Subject: [PATCH 6/6] Cut over to Github Actions only --- .github/workflows/linux.yaml | 21 ++++++++++--- .github/workflows/macos.yaml | 4 +-- .github/workflows/windows.yaml | 19 +++++++++--- .travis.yml | 35 --------------------- CHANGELOG.md | 4 +-- README.md | 56 ++++++++++++++++++---------------- appveyor.yml | 33 -------------------- 7 files changed, 63 insertions(+), 109 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index c89ed912..59185570 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -5,6 +5,21 @@ name: linux on: [push, pull_request] jobs: + rspec: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for rspec + - name: Build and Execute + run: | + g++ -v + bundle install + bundle exec rspec --backtrace + rubocop: runs-on: ubuntu-latest steps: @@ -16,11 +31,9 @@ jobs: # Install and run Arduino CI tests for rubocop - name: Build and Execute run: | - g++ -v bundle install bundle exec rubocop --version bundle exec rubocop -D . - bundle exec rspec --backtrace TestSomething: runs-on: ubuntu-latest @@ -34,7 +47,6 @@ jobs: - name: Build and Execute run: | g++ -v - bundle install cd SampleProjects/TestSomething bundle install bundle exec arduino_ci.rb @@ -51,8 +63,7 @@ jobs: - name: Build and Execute run: | g++ -v - bundle install cd SampleProjects/NetworkLib - ./scripts/install.sh + sh ./scripts/install.sh bundle install bundle exec arduino_ci.rb diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 7dfcc2b6..68d7ed3c 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -13,7 +13,7 @@ jobs: with: ruby-version: 2.6 - # Install and run Arduino CI tests for rubocop + # Install and run Arduino CI tests for rspec - name: Build and Execute run: | g++ -v @@ -47,7 +47,6 @@ jobs: - name: Build and Execute run: | g++ -v - bundle install cd SampleProjects/TestSomething bundle install bundle exec arduino_ci.rb @@ -64,7 +63,6 @@ jobs: - name: Build and Execute run: | g++ -v - bundle install cd SampleProjects/NetworkLib sh ./scripts/install.sh bundle install diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 59a5501b..4b65ff81 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -5,6 +5,21 @@ name: windows on: [push, pull_request] jobs: + rspec: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + + # Install and run Arduino CI tests for rspec + - name: Build and Execute + run: | + g++ -v + bundle install + bundle exec rspec --backtrace + rubocop: runs-on: windows-latest steps: @@ -16,11 +31,9 @@ jobs: # Install and run Arduino CI tests for rubocop - name: Build and Execute run: | - g++ -v bundle install bundle exec rubocop --version bundle exec rubocop -D . - bundle exec rspec --backtrace TestSomething: runs-on: windows-latest @@ -34,7 +47,6 @@ jobs: - name: Build and Execute run: | g++ -v - bundle install cd SampleProjects/TestSomething bundle install bundle exec arduino_ci.rb @@ -51,7 +63,6 @@ jobs: - name: Build and Execute run: | g++ -v - bundle install cd SampleProjects/NetworkLib bash -x ./scripts/install.sh bundle install diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 36067457..00000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -sudo: false -language: ruby - -os: - - linux - - osx - -env: - - BADGE=linux - - BADGE=osx - -# hack to get some OS-specific badges -matrix: - exclude: - - os: linux - env: BADGE=osx - - os: osx - env: BADGE=linux - -#before_install: gem install bundler -v 1.15.4 -script: - - g++ -v - - bundle install - - bundle exec rubocop --version - - bundle exec rubocop -D . - - bundle exec rspec --backtrace - - cd SampleProjects/TestSomething - - bundle install - - bundle exec arduino_ci.rb - - cd ../NetworkLib - - cd scripts - - bash -x ./install.sh - - cd .. - - bundle install - - bundle exec arduino_ci.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index bad6404c..563171de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,9 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Code coverage tooling - Explicit check and warning for library directory names that do not match our guess of what the library should/would be called - Symlink tests for `Host` -- GitHub action for MacOS - Add documentation on how to use Arduino CI with GitHub Actions -- Allow tests to run on GitHub without external set up with GitHub Actions (for Windows and Ubuntu) +- Allow tests to run on GitHub without external set up, via GitHub Actions (Windows, Linux, MacOS) ### Changed - Arduino backend is now `arduino-cli` version `0.13.0` @@ -32,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed - `ARDUINO_CI_SKIP_SPLASH_SCREEN_RSPEC_TESTS` no longer affects any tests because there are no longer splash screens since switching to `arduino-cli` - `CIConfig.package_builtin?` as this is no longer relevant to the `arduino-cli` backend (which has no built-in packages) +- Travis and Appveyor CI ### Fixed - Mismatches between library names in `library.properties` and the directory names, which can cause cryptic failures diff --git a/README.md b/README.md index 57dc3e0a..fbc0a4ed 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,14 @@ You want to precisely replicate certain software states in your library, but you You want your Arduino library to be automatically built and tested every time someone contributes code to your project on GitHub, but the Arduino IDE lacks the ability to run unit tests. [Arduino CI](https://github.com/Arduino-CI/arduino_ci) provides that ability. -`arduino_ci` is a cross-platform build/test system, consisting of a Ruby gem and a series of C++ mocks. It enables tests to be run both locally and as part of a CI service like Travis or Appveyor. Any OS that can run the Arduino IDE can run `arduino_ci`. +`arduino_ci` is a cross-platform build/test system, consisting of a Ruby gem and a series of C++ mocks. It enables tests to be run both locally and as part of a CI service like GitHub Actions, TravisCI, Appveyor, etc. Any OS that can run the Arduino IDE can run `arduino_ci`. -   | Linux | macOS | Windows --------------------|:------|:------|:-------- -**AppVeyor** | | | [![Windows Build status](https://ci.appveyor.com/api/projects/status/abynv8xd75m26qo9/branch/master?svg=true)](https://ci.appveyor.com/project/ianfixes/arduino-ci) -**GitHub Actions** | [![Arduino CI](https://github.com/Arduino-CI/arduino_ci/workflows/linux/badge.svg)](https://github.com/Arduino-CI/arduino_ci/actions?workflow=linux) | | [![Arduino CI](https://github.com/Arduino-CI/arduino_ci/workflows/windows/badge.svg)](https://github.com/Arduino-CI/arduino_ci/actions?workflow=windows) -**Travis CI** | [![Linux Build Status](http://badges.herokuapp.com/travis/Arduino-CI/arduino_ci?env=BADGE=linux&label=build&branch=master)](https://travis-ci.org/Arduino-CI/arduino_ci) | [![OSX Build Status](http://badges.herokuapp.com/travis/Arduino-CI/arduino_ci?env=BADGE=osx&label=build&branch=master)](https://travis-ci.org/Arduino-CI/arduino_ci) | + +Platform | CI Status +---------|:--------- +OSX | [![OSX Build Status](https://github.com/Arduino-CI/arduino_ci/workflows/macos/badge.svg)](https://github.com/Arduino-CI/arduino_ci/actions?workflow=macos) +Linux | [![Linux Build Status](https://github.com/Arduino-CI/arduino_ci/workflows/linux/badge.svg)](https://github.com/Arduino-CI/arduino_ci/actions?workflow=linux) +Windows | [![Windows Build status](https://github.com/Arduino-CI/arduino_ci/workflows/windows/badge.svg)](https://github.com/Arduino-CI/arduino_ci/actions?workflow=windows) ## Comparison to Other Arduino Testing Tools @@ -130,6 +131,28 @@ The following prerequisites must be fulfilled: > **Note:** `arduino_ci.rb` expects to be run from the root directory of your Arduino project library. +#### GitHub Actions + +GitHub Actions allows you to automate your workflows directly in GitHub. +No additional steps are needed. +Just create a YAML file with the information below in your repo under the `.github/workflows/` directory. + +```yaml +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 +``` + + #### Travis CI You'll need to go to https://travis-ci.org/profile/ and enable testing for your Arduino project. Once that happens, you should be all set. The script will test all example projects of the library and all unit tests. @@ -158,27 +181,6 @@ test_script: - bundle exec arduino_ci.rb ``` -#### GitHub Actions - -GitHub Actions allows you to automate your workflows directly in GitHub. -No additional steps are needed. -Just create a YAML file with the information below in your repo under the `.github/workflows/` directory. - -```yaml -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 -``` - ## Known Problems diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index d8576b06..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,33 +0,0 @@ -install: - - set PATH=C:\Ruby22\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 - -before_test: - - ruby -v - - gem -v - - bundle -v - - g++ -v - -test_script: - # https://help.appveyor.com/discussions/problems/5170-progresspreference-not-works-always-shown-preparing-modules-for-first-use-in-stderr - - ps: $ProgressPreference = "SilentlyContinue" - - bundle exec rubocop --version - - bundle exec rubocop -D . - - bundle exec rspec --backtrace - - cd SampleProjects\TestSomething - - bundle install - - bundle exec arduino_ci.rb - - cd ../NetworkLib - - cd scripts - - install.sh - - cd .. - - bundle install - - bundle exec arduino_ci.rb