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 0e10376 commit 0d38062
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 23 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: build

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

jobs:
platformio-build:
strategy:
matrix:
type: ["LPS35HW_fast_reading", "LPS35HW_low_power", "LPS35HW_test"]

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
- name: Compile ${{ matrix.type }}
run: |
pio ci --lib="." --board=uno --board=zero --board=esp8285 --board=esp32dev --board=bluepill_f103c8
env:
PLATFORMIO_CI_SRC: examples/${{ matrix.type }}

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

- board: "Zero"
platform: "arduino:samd"
fqbn: "arduino:samd:arduino_zero_native"
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

- board: "STM32F103C8"
platform: "STM32:stm32"
fqbn: "STM32:stm32:GenF1:pnum=BLUEPILL_F103C8"
url: https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json

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

- name: Prepare
run: |
cp ./LPS35HW.cpp ./examples/LPS35HW_fast_reading
cp ./LPS35HW.h ./examples/LPS35HW_fast_reading
cp ./LPS35HW.cpp ./examples/LPS35HW_low_power
cp ./LPS35HW.h ./examples/LPS35HW_low_power
cp ./LPS35HW.cpp ./examples/LPS35HW_test
cp ./LPS35HW.h ./examples/LPS35HW_test
- 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/setup-arduino-cli@v1.1.1

- name: "Install platform for ${{ matrix.board }}"
run: |
arduino-cli core update-index
arduino-cli core install ${{ matrix.platform }}
env:
ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS: ${{ matrix.url }}

- name: Compile LPS35HW_fast_reading
run: arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/LPS35HW_fast_reading

- name: Compile LPS35HW_low_power
run: arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/LPS35HW_low_power

- name: Compile LPS35HW_test
run: arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/LPS35HW_test
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
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# LPS35HW pressure sensor library (I2C)
[![Build Status](https://travis-ci.org/pilotak/LPS35HW.svg?branch=master)](https://travis-ci.org/pilotak/LPS35HW)
[![build](https://github.com/pilotak/LPS35HW/workflows/build/badge.svg)](https://github.com/pilotak/LPS35HW/actions)
[![Framework Badge Arduino](https://img.shields.io/badge/framework-arduino-00979C.svg)](https://arduino.cc)

## Fully compatible with following barometers
Expand Down

0 comments on commit 0d38062

Please sign in to comment.