Skip to content

Commit

Permalink
Update examples, tools, migrate to GitHub actions
Browse files Browse the repository at this point in the history
Signed-off-by: Sara Damiano <[email protected]>
  • Loading branch information
SRGDamia1 committed Mar 24, 2021
1 parent 92055d3 commit dbd2b12
Show file tree
Hide file tree
Showing 23 changed files with 1,495 additions and 35 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/build_documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Build and Publish Documentation

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
# Also trigger on page_build, as well as release created events
page_build:
release:
types: # This configuration does not affect the page_build event above
- created

env:
DOXYGEN_VERSION: Release_1_8_20

jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"

steps:
# check out the Arduino-SDI-12 repo
- uses: actions/checkout@v2
with:
path: code_docs/Arduino-SDI-12

- name: Restore or Cache pip
uses: actions/[email protected]
id: cache_pip
with:
path: ~/.cache/pip
# if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
# if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Restore or Cache PlatformIO and Libraries
uses: actions/[email protected]
id: cache_pio
with:
path: ~/.platformio
# if nothing in the lock files has changed, then it will be a "cache hit"
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Set up Python
uses: actions/setup-python@v2

# This should be pulled from cache, if there's not a new version
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
# Install *all* the dependencies!
# We're including the dependencies just so the includes can follow in the doxygen pre-processor
- name: Install the dependencies at global level
run: |
echo "::debug::Installing greygnome/EnableInterrupt"
pio lib -g install greygnome/EnableInterrupt
- name: Update Libraries from Cache
run: pio lib -g update

- name: Install GraphViz (dot)
run: sudo apt-get -y install graphviz

- name: Restore or Cache Doxygen
id: cache_doxygen
uses: actions/[email protected]
with:
path: doxygen-src
key: ${{ runner.os }}-doxygen-${{ env.DOXYGEN_VERSION }}

- name: Clone and build doxygen
if: steps.cache_doxygen.outputs.cache-hit != 'true'
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: |
cd ${{ github.workspace }}/code_docs/ModularSensors/
chmod +x continuous_integration/build-install-doxygen.sh
sh continuous_integration/build-install-doxygen.sh
# This should be pulled from cache, if there's not a new version
- name: Install Pygments and other m.css requirements
run: pip3 install jinja2 Pygments beautifulsoup4

# check out my fork of m.css, for processing Doxygen output
- name: Checkout m.css
uses: actions/checkout@v2
with:
# Repository name with owner. For example, actions/checkout
repository: SRGDamia1/m.css
path: code_docs/m.css

- name: Generate all the documentation
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: |
cd ${{ github.workspace }}/code_docs/ModularSensors/
chmod +x continuous_integration/generate-documentation.sh
sh continuous_integration/generate-documentation.sh
- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ github.workspace }}/code_docs/ModularSensorsDoxygen/m.css
84 changes: 84 additions & 0 deletions .github/workflows/build_examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build Examples

# Triggers the workflow on push or pull request events
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"

strategy:
matrix:
example:
[
examples/a_wild_card/,
examples/b_address_change/,
examples/c_check_all_addresses/,
examples/d_simple_logger/,
examples/e_simple_parsing/,
examples/f_basic_data_request/,
examples/g_terminal_window/,
examples/h_SDI-12_slave_implementation/,
examples/i_SDI-12_interface/,
examples/j_external_pcint_library/,
examples/k_concurrent_logger/,
]

steps:
- uses: actions/checkout@v2

- name: Set variables
run: |
if [[ -z "${GITHUB_HEAD_REF}" ]]; then
echo "::debug::Push to commit ${GITHUB_SHA}"
echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_SHA}" >> $GITHUB_ENV
else
echo "::debug::Pull Request from the ${GITHUB_HEAD_REF} branch"
echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi
- name: Restore or Cache pip
uses: actions/[email protected]
with:
path: ~/.cache/pip
# if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
# if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Restore or Cache PlatformIO and Libraries
uses: actions/[email protected]
with:
path: ~/.platformio
# if nothing in the lock files has changed, then it will be a "cache hit" and pip will be restored
# otherwise, it will be a "cache miss" and a new cache of libraries will be created if the job completes successfully
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

- name: Set up Python
uses: actions/setup-python@v2

# This should be pulled from cache, if there's not a new version
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
if: ${{ matrix.example != 'k_concurrent_logger'}}
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
run: |
platformio lib --global update
echo "${{ env.LIBRARY_INSTALL_SOURCE }}"
platformio ci --board=mayfly --board=feather32u4 --board=adafruit_feather_m0 --board=uno --board=megaatmega2560 --board=huzzah --board=featheresp32
- name: Run PlatformIO
if: ${{ matrix.example == 'k_concurrent_logger'}}
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
run: |
platformio lib --global update
echo "${{ env.LIBRARY_INSTALL_SOURCE }}"
pio lib --global install EnableInterrupt
platformio ci --board=mayfly --board=feather32u4 --board=adafruit_feather_m0 --board=uno --board=megaatmega2560
18 changes: 18 additions & 0 deletions .github/workflows/changelog_reminder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: pull_request
name: Changelog Reminder
jobs:
remind:
name: Changelog Reminder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token

- name: Changelog Reminder
uses: peterjgrainger/[email protected]
with:
changelog_regex: '/ChangeLog\/.*\/*.md'
customPrMessage: 'Please add your changes to the change log!'
env:
GITHUB_TOKEN: ${{ secrets.SARA_PUSH_TOKEN }}
72 changes: 72 additions & 0 deletions .github/workflows/prepare_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
on:
push:
branches:
- master
# Sequence of patterns matched against refs/tags
paths:
- 'VERSION' # Push events when the VERSION file changes
workflow_dispatch:

name: Prepare a new release

env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}

jobs:
release:
name: Prepare a new release
runs-on: ubuntu-latest

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

- name: Set variables
run: |
echo "::debug::Get the current version number"
VER=$(cat VERSION)
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Restore or Cache pip
uses: actions/[email protected]
with:
path: ~/.cache/pip
# if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
# if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Set up Python
uses: actions/setup-python@v2

# This should be pulled from cache, if there's not a new version
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Get notes
id: generate_notes
uses: anmarkoulis/commitizen-changelog-reader@master
with:
# NOTE: Need to add the refs/tags to work with the generate notes action
tag_name: ${{ format('refs/tags/{0}', env.VERSION) }}
changelog: ChangeLog.md

# Create a new release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: false
body: ${{join(fromJson(steps.generate_notes.outputs.notes).notes, '')}}

# Publish the new release to the pio package manager
- name: Publish release to PIO
id: publish-pio
run: pio package publish
31 changes: 31 additions & 0 deletions .github/workflows/verify_library_json.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Verify JSON structure for library manifest

# Triggers the workflow on push or pull request events
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"

steps:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/[email protected]

- name: Cache Node.js modules
uses: actions/[email protected]
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: install jsonlint
run: npm install -g jsonlint

- name: run jsonlint
run: jsonlint -q library.json
75 changes: 75 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

****

## v2.1.3 (2021-03-24) [Patches for ATTiny](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v2.1.1)

### Improvements
- Migrate from Travis to GitHub actions

## v2.1.1 (2020-08-20) [Patches for ATTiny](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v2.1.1)

### Bug Fixes
- fixes for the timer and pre-scaler for the ATTiny, courtesy of @gabbas1

## v2.1.0 (2020-07-10) [Library Rename and ESP support](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v2.1.0)

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3939731.svg)](https://doi.org/10.5281/zenodo.3939731)

**To comply with requirements for inclusion in the Arduino IDE, the word Arduino has been removed from the name of this library!** The repository name is unchanged.

### New Features
- Adds support for Espressif ESP8266 and ESP32
- Add option of adding a delay before sending a command to allow the sensor to wake. Take advantage of this by calling the function ```sendCommand(command, extraWakeTime)```. This may resolve issues with some Campbell sensors that would not previous communicate with this library. See https://www.envirodiy.org/topic/campbell-scientific-cs-215-sdi-12-communication-issues-w-mayfly/#post-14103
- Adds Doxygen (Javadoc) style comments to **ALL** members of the library. The generated documentation is available at https://envirodiy.github.io/Arduino-SDI-12/.

## v1.3.6 (2019-08-29) [Fixed extra compiler warnings](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v1.3.6)

### Bug Fixes
- A very minor update to fix compiler warnings found when using -Wextra in addition to -Wall.

## v1.3.5 (2019-07-01) [Removed SAMD Tone Conflict](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v1.3.5)

### Improvements
- SAMD boards will no longer have a conflict with the Tone functions in the Arduino core. AVR boards will still conflict. If you need to use Tone and SDI-12 together for some reason on an AVR boards, you must use the "delayBase" branch.
- Examples were also updated and given platformio.ini files.

## v1.3.4 (2019-10-29) [Timer class](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v1.3.4)

### Improvements
- Made the timer changes into a compiled class.

Maintaining interrupt control for SAMD processors as there are no interrupt vectors to be in conflict. Because the pin mode changes from input to output and back, allowing another library to control interrupts doesn't work.

## v1.3.3 (2018-05-11) [Unset prescalers](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v1.3.3)

### Improvements
- Now unsetting timer prescalers and setting the isActive pointer to NULL in both the end and the destructor functions.
- Also some clean-up of the examples.

## v1.3.1 (2018-04-06) [Added processor timer for greater stability](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v1.3.1)

### New Features
- Changed the incoming data ISR to use a processor timer, this makes the reception more stable, especially when the ISR is controlled by an external library. This also creates some conflicts with other libraries that use Timer2.

### Improvements
- Made changes to the write functions to use the timer to reduce the amount of time that all system interrupts are off.
- Forcing all SDI-12 objects to use the same buffer to reduce ram usage.

## v1.1.0 (2018-03-15) [Better integration inside other libraries](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v1.1.0)

### Improvements
- Added notes and an empty constructor/populated begin method to allow this library to be more easily called inside of other libraries.

## v1.0.6 (2018-03-09) [Fixed timeout values](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v1.0.6)

### Bug Fixes
- Fixes the time-out values for the ParseInt and ParseFloat to be -9999. This was the intended behavior all along, but at some point those functions changed in the stream library and the identically named functions within SDI-12 intended to "hide" the stream functions ceased to be called.

## v1.0.1 (2017-05-16) [Initial Release](https://github.com/EnviroDIY/Arduino-SDI-12/releases/tag/v1.0.1)

The first "official" release of this interrupt-based SDI-12 library for AVR and SAMD Arduino boards.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v2.1.3
Loading

0 comments on commit dbd2b12

Please sign in to comment.