-
Notifications
You must be signed in to change notification settings - Fork 127
60 lines (60 loc) · 2.15 KB
/
ebnf.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
name: ebnf
on:
push:
branches:
- master
paths-ignore: ['paper/**', 'sandbox/**']
concurrency:
group: ebnf-${{ github.ref }}
cancel-in-progress: true
jobs:
ebnf:
runs-on: ubuntu-22.04
env:
CONVERT_PATH: /tmp/antlr4-to-bnf-converter
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- run: |
sudo apt-get update
sudo apt-get -y install ghostscript imagemagick texlive-extra-utils pdf2svg
- uses: teatimeguest/[email protected]
with:
update-all-packages: true
packages: scheme-basic geometry xcolor naive-ebnf microtype etoolbox
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-
- run: |
mkdir -p "$CONVERT_PATH"
wget --quiet http://public.yegor256.com/convert.zip -O /tmp/convert.zip
unzip -o -d "$CONVERT_PATH" /tmp/convert.zip
- run: sudo sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml
- run: |
mvn com.yegor256:antlr2ebnf-maven-plugin:0.0.7:generate \
-pl :eo-parser --debug --errors --batch-mode --quiet \
"-Dantlr2ebnf.convertDir=$CONVERT_PATH" \
"-Dantlr2ebnf.specials=eol,eop,tab,untab" \
"-Dantlr2ebnf.margin=40"
- run: |
set -x
cp eo-parser/target/ebnf/org/eolang/parser/Program.pdf .
pdfcrop --margins '10 10 10 10' Program.pdf crop.pdf
pdf2svg crop.pdf ebnf.svg
convert -density 300 -quality 100 -transparent white -colorspace RGB crop.pdf ebnf.png
ls -al
mkdir gh-pages
cp ebnf.png gh-pages
cp ebnf.svg gh-pages
- uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: gh-pages
clean: false
if: github.ref == 'refs/heads/master'