Skip to content

Commit

Permalink
ci: test arduino examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Feb 22, 2024
1 parent 4cecc7d commit b3dd1be
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* text=auto
* text eol=lf

src/** linguist-generated
bindings/** linguist-generated
Expand Down
34 changes: 30 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- bindings/**
- binding.gyp
pull_request:
branches: ["*"]
paths:
- grammar.js
- src/**
Expand All @@ -18,6 +17,33 @@ on:

jobs:
test:
uses: tree-sitter-grammars/.github/.github/workflows/ci.yml@main
with:
test-library: true
name: Test parser
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Set up repository
uses: tree-sitter-grammars/actions/setup@main
with:
submodules: true
node-version: ${{vars.NODE_VERSION}}
ref: 3ad4da8d411a0b05e0eee6cfa733f80d0359eccb
- name: Run tests
uses: tree-sitter-grammars/actions/test@main
with:
test-library: ${{runner.os == 'Linux'}}
examples: examples/examples/**/*.ino
fuzz:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for scanner changes
continue-on-error: true
id: scanner-changes
run: "! git diff --quiet -- src/scanner.c"
- name: Fuzz parser
if: steps.scanner.changes.outcome == 'success'
uses: tree-sitter-grammars/tree-sitter-fuzz-action@v3
24 changes: 19 additions & 5 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,24 @@ on:
- cron: '0 0 * * 0' # every week
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update:
uses: tree-sitter-grammars/.github/.github/workflows/dependencies.yml@main
with:
# TODO: use the parent scanner
# parent-name: cpp
language-name: arduino
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up NodeJS
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{vars.NODE_VERSION}}
- name: Update dependencies
id: update
uses: tree-sitter-grammars/actions/update@main
with:
parent-name: cpp
language-name: arduino
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "arduino-examples"]
url = https://github.com/arduino/arduino-examples
path = examples
shallow = true
1 change: 1 addition & 0 deletions examples
Submodule examples added at 3ad4da

0 comments on commit b3dd1be

Please sign in to comment.