-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflows: add check for generated AT Parser
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
1 parent
6c65967
commit d97c680
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Check Generated AT Parser | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'lib/at_parser/at_match.re' | ||
|
||
jobs: | ||
compliance_job: | ||
runs-on: ubuntu-latest | ||
name: Check Generated AT Parser | ||
steps: | ||
- name: Update PATH for west | ||
run: | | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
path: ncs/nrf | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install re2c | ||
- name: Generate lexer | ||
working-directory: ncs/nrf/lib/at_parser | ||
run: | | ||
re2c at_match.re -o at_match.c -W --no-debug-info --tags | ||
- name: Compare lexers | ||
working-directory: ncs/nrf/lib/at_parser | ||
run: | | ||
if diff -q at_match.c 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 |