Skip to content

Commit

Permalink
#2242: ebnf job
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 12, 2023
1 parent 7390c0c commit 87a666b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 32 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ebnf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: ebnf
on:
push:
branches:
- master
paths-ignore: ['paper/**', 'sandbox/**']
pull_request:
branches:
- master
paths-ignore: ['paper/**', 'sandbox/**']
concurrency:
group: ebnf-${{ github.ref }}
cancel-in-progress: true
jobs:
ebnf:
runs-on: ubuntu-20.04
env:
CONVERT_PATH: /tmp/antlr4-to-bnf-converter
steps:
- uses: actions/checkout@v3
- run:
sudo apt-get update
sudo apt-get -y install ghostscript
sudo apt-get -y install imagemagick
- uses: teatimeguest/[email protected]
with:
update-all-packages: true
packages: scheme-basic naive-ebnf
- 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 http://public.yegor256.com/convert.zip -O /tmp/convert.zip
unzip -o -d $CONVERT_PATH /tmp/convert.zip
- run: mvn clean test -pl :eo-parser --errors --batch-mode
- run: |
cp eo-parser/src/test/resources/tex/ebnf.tex eo-parser/target/ebnf.tex
cd eo-parser/target
sed -i -e '/EBNF/{r ebnf.txt' -e 'd}' ebnf.tex
pdflatex ebnf.tex
convert -density 300 -quality 100 ebnf.pdf ebnf.png
mkdir gh-pages
cp ebnf.png gh-pages
- uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: eo-parser/target/gh-pages
clean: false
if: github.ref == 'refs/heads/master'
32 changes: 1 addition & 31 deletions .github/workflows/mvn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,8 @@ jobs:
os: [ubuntu-20.04, windows-2022, macos-12]
java: [11, 17, 18]
runs-on: ${{ matrix.os }}
env:
CONVERT_PATH: /tmp/convert
steps:
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get -y install ghostscript
if: matrix.os == 'ubuntu-20.04'
- uses: teatimeguest/[email protected]
with:
update-all-packages: true
packages: scheme-basic naive-ebnf
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand All @@ -38,27 +30,5 @@ jobs:
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 http://public.yegor256.com/convert.zip -O /tmp/convert.zip
unzip -o -d $CONVERT_PATH /tmp/convert.zip
if: matrix.os == 'ubuntu-20.04'
restore-keys: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-
- run: mvn clean install -Pqulice --errors --batch-mode
- run: sudo apt-get update && sudo apt-get install -y imagemagick
- run: |
cp eo-parser/src/test/resources/tex/ebnf.tex eo-parser/target/ebnf.tex
cd eo-parser/target
sed -i -e '/EBNF/{r ebnf.txt' -e 'd}' ebnf.tex
pdflatex ebnf.tex
convert -density 300 -quality 100 ebnf.pdf ebnf.png
mkdir gh-pages
cp ebnf.png gh-pages
if: matrix.os == 'ubuntu-20.04'
- uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: eo-parser/target/gh-pages
clean: false
if: github.ref == 'refs/heads/master' && matrix.os == 'ubuntu-20.04'
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,12 @@ Got the idea?

## Backus-Naur Form

This is our EBNF:
This is our [EBNF](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form):

<img alt="ENBF of EO" src="https://www.eolang.org/ebnf.png" width="100%" />

The image was [auto-generated]().

## What's Next?

Join [our Telegram group](https://t.me/polystat_org).
Expand Down

0 comments on commit 87a666b

Please sign in to comment.