Skip to content

Modernize continuous integration system #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
ignore-words-list = ,
check-filenames =
check-hidden =
skip = ./.git
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file
version: 2

updates:
# Configure check for outdated GitHub Actions actions in workflows.
# See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot
- package-ecosystem: github-actions
directory: / # Check the repository's workflows under /.github/workflows/
schedule:
interval: daily
28 changes: 28 additions & 0 deletions .github/workflows/check-arduino.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check Arduino

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
pull_request:
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

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

- name: Arduino Lint
uses: arduino/arduino-lint-action@v1
with:
compliance: specification
library-manager: update
# Always use this setting for official repositories. Remove for 3rd party projects.
official: true
project-type: library
108 changes: 90 additions & 18 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,92 @@
name: Compile Examples
on: [push, pull_request]

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
pull_request:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
fqbn: [
"arduino:samd:mkrzero"
]

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: arduino/actions/libraries/compile-examples@master
with:
fqbn: ${{ matrix.fqbn }}
libraries: SD
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest

env:
SKETCHES_REPORTS_PATH: sketches-reports

strategy:
fail-fast: false

matrix:
board:
- fqbn: arduino:samd:arduino_zero_edbg
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:mkr1000
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:mkrzero
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:mkrwifi1010
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:mkrfox1200
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:mkrwan1300
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:mkrwan1310
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:mkrgsm1400
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:mkrnb1500
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:mkrvidor4000
platforms: |
- name: arduino:samd
- fqbn: arduino:samd:nano_33_iot
platforms: |
- name: arduino:samd

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

- name: Compile examples
uses: arduino/compile-sketches@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fqbn: ${{ matrix.board.fqbn }}
platforms: ${{ matrix.board.platforms }}
libraries: |
# Install the library from the local path.
- source-path: ./
- name: SD
sketch-paths: |
- examples
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Save sketches report as workflow artifact
uses: actions/upload-artifact@v2
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: ${{ env.SKETCHES_REPORTS_PATH }}
24 changes: 24 additions & 0 deletions .github/workflows/report-size-deltas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Report Size Deltas

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/report-size-deltas.yml"
schedule:
# Run at the minimum interval allowed by GitHub Actions.
# Note: GitHub Actions periodically has outages which result in workflow failures.
# In this event, the workflows will start passing again once the service recovers.
- cron: "*/5 * * * *"
workflow_dispatch:
repository_dispatch:

jobs:
report:
runs-on: ubuntu-latest
steps:
- name: Comment size deltas reports to PRs
uses: arduino/report-size-deltas@v1
with:
# The name of the workflow artifact created by the sketch compilation workflow
sketches-reports-source: sketches-reports
29 changes: 20 additions & 9 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
name: Spell Check
on: [push, pull_request]

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
pull_request:
schedule:
# Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: arduino/actions/libraries/spell-check@master
spellcheck:
runs-on: ubuntu-latest

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

- name: Spell check
uses: codespell-project/actions-codespell@master
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ArduinoSound

[![Compile Examples Status](https://github.com/arduino-libraries/ArduinoSound/workflows/Compile%20Examples/badge.svg)](https://github.com/arduino-libraries/ArduinoSound/actions?workflow=Compile+Examples) [![Spell Check Status](https://github.com/arduino-libraries/ArduinoSound/workflows/Spell%20Check/badge.svg)](https://github.com/arduino-libraries/ArduinoSound/actions?workflow=Spell+Check)
[![Check Arduino status](https://github.com/arduino-libraries/ArduinoSound/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/ArduinoSound/actions/workflows/check-arduino.yml)
[![Compile Examples status](https://github.com/arduino-libraries/ArduinoSound/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/ArduinoSound/actions/workflows/compile-examples.yml)
[![Spell Check status](https://github.com/arduino-libraries/ArduinoSound/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/ArduinoSound/actions/workflows/spell-check.yml)

A simple way to play and analyze audio data using Arduino. Currently only supports SAMD21 boards and I2S audio devices.

Expand Down
20 changes: 10 additions & 10 deletions examples/AmplitudeSerialPlotter/AmplitudeSerialPlotter.ino
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
This example reads audio data from an Invensense's ICS43432 I2S microphone
breakout board, and prints out the amplitude to the Serial console. The
Serial Plotter built into the Arduino IDE can be used to plot the audio
amplitude data (Tools -> Serial Plotter)
This example reads audio data from an InvenSense ICS-43432 I2S microphone
breakout board, and prints out the amplitude to the Serial Monitor. The
Serial Plotter built into the Arduino IDE (Tools -> Serial Plotter) can be
used to plot the audio amplitude data.

Circuit:
* Arduino/Genuino Zero, MKRZero or MKR1000 board
* ICS43432:
* Arduino Zero, MKR Zero or MKR1000 board
* ICS-43432:
* GND connected GND
* 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKRZero)
* WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero)
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero)
* SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero)
* 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKR Zero)
* WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKR Zero)
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKR Zero)
* SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKR Zero)

created 23 November 2016
by Sandeep Mistry
Expand Down
16 changes: 8 additions & 8 deletions examples/ClapDetector/ClapDetector.ino
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/*
This example reads audio data from an Invensense's ICS43432 I2S microphone
This example reads audio data from an InvenSense ICS-43432 I2S microphone
breakout board, and uses the input to detect clapping sounds. An LED is
togggled when a clapp is detected.
toggled when a clap is detected.

Circuit:
* Arduino/Genuino Zero, MKRZero or MKR1000 board
* ICS43432:
* Arduino Zero, MKR Zero or MKR1000 board
* ICS-43432:
* GND connected GND
* 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKRZero)
* WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero)
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero)
* SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero)
* 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKR Zero)
* WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKR Zero)
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKR Zero)
* SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKR Zero)

created 18 November 2016
by Sandeep Mistry
Expand Down
20 changes: 10 additions & 10 deletions examples/SpectrumSerialPlotter/SpectrumSerialPlotter.ino
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
This example reads audio data from an Invensense's ICS43432 I2S microphone
breakout board, and prints out the spectrum to the Serial console. The
Serial Plotter built into the Arduino IDE can be used to plot the audio
amplitude data (Tools -> Serial Plotter)
This example reads audio data from an InvenSense ICS-43432 I2S microphone
breakout board, and prints out the spectrum to the Serial Monitor. The
Serial Plotter built into the Arduino IDE (Tools -> Serial Plotter) can be
used to plot the audio amplitude data.

Circuit:
* Arduino/Genuino Zero, MKRZero or MKR1000 board
* ICS43432:
* Arduino Zero, MKR Zero or MKR1000 board
* ICS-43432:
* GND connected GND
* 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKRZero)
* WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero)
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero)
* SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero)
* 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKR Zero)
* WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKR Zero)
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKR Zero)
* SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKR Zero)

created 21 November 2016
by Sandeep Mistry
Expand Down
12 changes: 6 additions & 6 deletions examples/WavePlayback/WavePlayback.ino
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/*
This reads a wave file from an SD card and plays it using the I2S interface to
a MAX08357 I2S Amp Breakout board.
a MAX98357 I2S Amp Breakout board.

Circuit:
* Arduino/Genuino Zero, MKRZero or MKR1000 board
* Arduino Zero, MKR Zero or MKR1000 board
* SD breakout or shield connected
* MAX08357:
* MAX98357:
* GND connected GND
* VIN connected 5V
* LRC connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero)
* BCLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero)
* DIN connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero)
* LRC connected to pin 0 (Zero) or pin 3 (MKR1000, MKR Zero)
* BCLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKR Zero)
* DIN connected to pin 9 (Zero) or pin A6 (MKR1000, MKR Zero)

created 15 November 2016
by Sandeep Mistry
Expand Down
18 changes: 9 additions & 9 deletions examples/WhistleDetector/WhistleDetector.ino
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
This example reads audio data from an Invensense's ICS43432 I2S microphone
This example reads audio data from an InvenSense ICS-43432 I2S microphone
breakout board, and uses the input to detect whistling sounds at a particular
frequency. When a whistle is detected, it's level is used to control the
brightness of an LED
frequency. When a whistle is detected, its level is used to control the
brightness of an LED.

Circuit:
* Arduino/Genuino Zero, MKRZero or MKR1000 board
* ICS43432:
* Arduino Zero, MKR Zero or MKR1000 board
* ICS-43432:
* GND connected GND
* 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKRZero)
* WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero)
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero)
* SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero)
* 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKR Zero)
* WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKR Zero)
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKR Zero)
* SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKR Zero)

created 30 November 2016
by Sandeep Mistry
Expand Down
2 changes: 1 addition & 1 deletion src/SDWaveFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int SDWaveFile::cue(long time)
offset = 0;
}

// make sure it's multiple of 512
// make sure it's a multiple of 512
offset = (offset / 512) * 512;

if ((uint32_t)offset > _file.size()) {
Expand Down