-
Notifications
You must be signed in to change notification settings - Fork 1.3k
42 lines (36 loc) · 1.14 KB
/
check-generated-at-parser.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Check Generated AT Parser
on:
pull_request:
paths:
- 'lib/at_parser/at_match.re'
jobs:
check-generated-at-parser:
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=3.0-1
- name: Generate lexer
working-directory: ncs/nrf/lib/at_parser
run: |
re2c at_match.re -o at_match.c -W --tags --no-debug-info --no-generation-date --no-version
- 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