Skip to content

Commit 1aced65

Browse files
committed
Initial Commit
0 parents  commit 1aced65

File tree

25 files changed

+6774
-0
lines changed

25 files changed

+6774
-0
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: build
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
env:
10+
BOARD: "Arduino Leonardo" # board name, human-readable
11+
BOARD_PLATFORM: "arduino:avr" # board platform, to be installed by the CLI
12+
BOARD_FQBN: "arduino:avr:leonardo" # fully qualified board name for compilation
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Setup Arduino CLI
19+
uses: arduino/[email protected]
20+
21+
- name: Install Board Platform
22+
run: |
23+
arduino-cli core update-index
24+
arduino-cli core install $BOARD_PLATFORM
25+
26+
- name: Add Library Symbolic Link to Repo
27+
run: |
28+
mkdir --parents "$HOME/Arduino/libraries"
29+
ln --symbolic "$PWD" "$HOME/Arduino/libraries/."
30+
31+
- name: Install Dependencies
32+
run: |
33+
git clone https://github.com/MHeironimus/ArduinoJoystickLibrary $HOME/Arduino/libraries/Joystick
34+
35+
- name: Compile Library Examples
36+
run: |
37+
buildSketchPath() {
38+
sktch=${1##*/examples/};
39+
sktch=${sktch%/*.ino};
40+
echo -e "\nBuilding sketch $sktch.ino";
41+
arduino-cli compile --fqbn $BOARD_FQBN "$1";
42+
}
43+
buildExamples() {
44+
IFS=$'\n'; set -f;
45+
for f in $(find $PWD/examples/ -name '*.ino');
46+
do
47+
buildSketchPath $f;
48+
done;
49+
unset IFS; set +f;
50+
}
51+
buildExamples

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: docs
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: released
7+
8+
jobs:
9+
docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Fetch Repository Reference Info
14+
id: repo-info
15+
run: |
16+
git fetch --prune --unshallow --tags
17+
RELEASE_TAG=${{ github.event.release.tag_name }}
18+
LATEST_TAG=$(git tag | grep -E '^v[0-9]' | sort -V | tail -1)
19+
GIT_SHA_SHORT=$(sed 's/\(.\{7\}\).*/\1/' <<< "$GITHUB_SHA")
20+
PROJECT_NUMBER=${RELEASE_TAG:-${LATEST_TAG:-$GIT_SHA_SHORT}}
21+
COMMIT_MSG=$PROJECT_NUMBER
22+
if [ "$PROJECT_NUMBER" != "$GIT_SHA_SHORT" ]; then COMMIT_MSG+=" ($GITHUB_SHA)"; fi
23+
echo "The project number is \"$PROJECT_NUMBER\" and the commit message is \"$COMMIT_MSG\""
24+
echo "::set-output name=project-number::$PROJECT_NUMBER"
25+
echo "::set-output name=commit-message::$COMMIT_MSG"
26+
27+
- name: Install Doxygen
28+
env:
29+
DOXYGEN_VERSION: 1.9.3
30+
run: |
31+
wget -q https://www.doxygen.nl/files/doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz
32+
tar -xf doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz
33+
cd doxygen-${{ env.DOXYGEN_VERSION }} && sudo make install
34+
sudo apt-get install libclang1-9 libclang-cpp9
35+
36+
- name: Install Themes
37+
env:
38+
DOXYGEN_AWESOME_VERSION: 2.0.3
39+
working-directory: ./docs
40+
run: |
41+
git clone --depth 1 -b v${{ env.DOXYGEN_AWESOME_VERSION }} https://github.com/jothepro/doxygen-awesome-css
42+
43+
- name: Generate Docs
44+
working-directory: ./docs
45+
run: |
46+
sed -i -E 's/(PROJECT_NUMBER\s*=\s*).*/\1 ${{ steps.repo-info.outputs.project-number }}/g' Doxyfile
47+
doxygen Doxyfile
48+
49+
- name: Deploy Docs
50+
uses: peaceiris/actions-gh-pages@v3
51+
with:
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
publish_branch: gh-pages
54+
publish_dir: ./docs/generated/html
55+
destination_dir: docs
56+
user_name: github-actions[bot]
57+
user_email: github-actions[bot]@users.noreply.github.com
58+
full_commit_message: Update docs for ${{ steps.repo-info.outputs.commit-message }}

0 commit comments

Comments
 (0)