Skip to content

Commit

Permalink
GithubCI
Browse files Browse the repository at this point in the history
  • Loading branch information
pilotak committed Dec 21, 2020
1 parent 44983b5 commit a78fbb0
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 66 deletions.
143 changes: 143 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: build

on:
push:
branches:
- master
pull_request:
branches:
- "*"

jobs:
platformio-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
pio lib -g install "pilotak/MovingAverage"
pio lib -g install "pilotak/MovingAverageAngle"
- name: Compile UNO
run: |
pio ci --lib="." --board=uno
env:
PLATFORMIO_CI_SRC: ./examples/timers/WeatherMeters_AVR

- name: Compile ESP8266
run: |
pio ci --lib="." --board=esp8285
env:
PLATFORMIO_CI_SRC: ./examples/timers/WeatherMeters_ESP8266

- name: Compile ESP32
run: |
pio ci --lib="." --board=esp32dev
env:
PLATFORMIO_CI_SRC: ./examples/timers/WeatherMeters_ESP32

- name: Compile adhoc
run: |
pio ci --lib="." --board=uno --board=esp8285 --board=esp32dev
env:
PLATFORMIO_CI_SRC: ./examples/WeatherMeters_adhoc

- name: Compile external ADC
run: |
pio lib -g install "pilotak/MCP3X21"
pio ci --lib="." --board=uno --board=esp8285 --board=esp32dev
env:
PLATFORMIO_CI_SRC: ./examples/WeatherMeters_external_ADC

arduino-build:
strategy:
matrix:
board: ["UNO", "ESP8266", "ESP32"]
include:
- board: "UNO"
platform: "arduino:avr"
fqbn: "arduino:avr:uno"
url: ""

- board: "ESP8266"
platform: "esp8266:esp8266"
fqbn: "esp8266:esp8266:esp8285"
url: https://arduino.esp8266.com/stable/package_esp8266com_index.json

- board: "ESP32"
platform: "esp32:esp32"
fqbn: "esp32:esp32:esp32"
url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
run: |
cp ./WeatherMeters.h ./examples/WeatherMeters_external_ADC
cp ./WeatherMeters.h ./examples/WeatherMeters_adhoc
- name: Set up Python
if: ${{ matrix.board == 'ESP32' }}
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install pyserial
if: ${{ matrix.board == 'ESP32' }}
run: |
python -m pip install --upgrade pip
pip install --upgrade pyserial
- name: Setup Arduino CLI
uses: arduino/[email protected]

- name: "Install platform for ${{ matrix.board }}"
run: |
arduino-cli core update-index
arduino-cli core install ${{ matrix.platform }}
arduino-cli lib install --git-url https://github.com/pilotak/MovingAverage
arduino-cli lib install --git-url https://github.com/pilotak/MovingAverageAngle
env:
ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS: ${{ matrix.url }}
ARDUINO_ENABLE_UNSAFE_LIBRARY_INSTALL: true

- name: Compile timer UNO
if: ${{ matrix.board == 'UNO' }}
run: |
cp ./WeatherMeters.h ./examples/timers/WeatherMeters_AVR
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/timers/WeatherMeters_AVR
- name: Compile timer ESP8266
if: ${{ matrix.board == 'ESP8266' }}
run: |
cp ./WeatherMeters.h ./examples/timers/WeatherMeters_ESP8266
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/timers/WeatherMeters_ESP8266
- name: Compile timer ESP32
if: ${{ matrix.board == 'ESP32' }}
run: |
cp ./WeatherMeters.h ./examples/timers/WeatherMeters_ESP32
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/timers/WeatherMeters_ESP32
- name: Compile adhoc
run: |
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/WeatherMeters_adhoc
- name: Compile external ADC
run: |
arduino-cli lib install --git-url https://github.com/pilotak/MCP3X21
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/WeatherMeters_external_ADC
env:
ARDUINO_ENABLE_UNSAFE_LIBRARY_INSTALL: true
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: release

on:
push:
tags:
- "v*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
id: prepare
run: |
git fetch --prune --unshallow --tags -f
VERSION=$(git tag --points-at HEAD)
VERSION=${VERSION//v}
echo "## :bookmark_tabs: Changes" >>"CHANGELOG.md"
git log --pretty=format:"- %s %H%n" $(git describe --abbrev=0 --tags $(git describe --tags --abbrev=0)^)...$(git describe --tags --abbrev=0) >>"CHANGELOG.md"
echo ::set-output name=version::${VERSION}
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.prepare.outputs.version }}
body_path: CHANGELOG.md
draft: false
prerelease: false
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Weather Meters
[![Build Status](https://travis-ci.org/pilotak/WeatherMeters.svg?branch=master)](https://travis-ci.org/pilotak/WeatherMeters) [![Framework Badge Arduino](https://img.shields.io/badge/framework-arduino-00979C.svg)](https://arduino.cc)
[![build](https://github.com/pilotak/WeatherMeters/workflows/build/badge.svg)](https://github.com/pilotak/WeatherMeters/actions)
[![Framework Badge Arduino](https://img.shields.io/badge/framework-arduino-00979C.svg)](https://arduino.cc)

Arduino library for processing wind speed, wind wane and rain gauge sensors (WH1080, WH1090, Sparkfun)

Expand Down
53 changes: 0 additions & 53 deletions examples/timers/WeatherMeters_STM32/WeatherMeters_STM32.ino

This file was deleted.

21 changes: 9 additions & 12 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@
"name": "WeatherMeters",
"keywords": "weather, meters, processing, wind, speed, direction, rain",
"description": "Weather meters processing library",
"repository":
{
"repository": {
"type": "git",
"url": "https://github.com/pilotak/WeatherMeters.git"
},
"authors":
{
"name": "Pavel Slama",
"email": "[email protected]",
"url": "https://github.com/pilotak"
"authors": {
"name": "Pavel Slama",
"email": "[email protected]",
"url": "https://github.com/pilotak"
},
"dependencies":
{
"name": "MovingAverageAngle",
"version": "^1.0.3"
"dependencies": {
"name": "pilotak/MovingAverageAngle",
"version": "^1.0.4"
},
"version": "2.0.0",
"frameworks": "arduino",
"platforms": "*"
}
}
1 change: 1 addition & 0 deletions library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ includes=WeatherMeters.h
category=Signal Input/Output
version=2.0.0
architectures=*
depends=MovingAverageAngle

0 comments on commit a78fbb0

Please sign in to comment.