Skip to content

Commit

Permalink
workflows: add check for generated AT Parser
Browse files Browse the repository at this point in the history
Adds check for generated AT Parser lexer to determine
if it's up to date according to the regex source.

Signed-off-by: Mirko Covizzi <[email protected]>
  • Loading branch information
MirkoCovizzi committed Aug 26, 2024
1 parent 6c65967 commit 4335d38
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/check-generated-lexer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Check Generated AT Parser Lexer

on:
pull_request:
paths:
- 'lib/at_parser/at_match.re'

jobs:
compliance_job:
runs-on: ubuntu-latest
name: Check Generated AT Parser Lexer
steps:
- name: Update PATH for west

Check warning on line 13 in .github/workflows/check-generated-lexer.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (indentation)

.github/workflows/check-generated-lexer.yml:13 wrong indentation: expected 6 but found 4
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Checkout sources
uses: nrfconnect/action-checkout-west-update@main
with:
git-fetch-depth: 0
git-ref: ${{ github.event.pull_request.head.sha }}

- name: Install dependencies
run: |
sudo apt-get install re2c
- name: Generate lexer
run: |
re2c at_match.re -o at_match.c -W --no-debug-info --tags
- name: Compare lexers
run: |
if diff -q at_match.c ncs/nrf/lib/at_parser/generated/at_match.c > /dev/null; then
echo "Lexer is up to date."
else
echo "Lexer is not up to date. Please re-generate the lexer and update the PR."
exit 1
fi

0 comments on commit 4335d38

Please sign in to comment.