From 87a666bd0e931ad94f186a61a6f18e660c4ce298 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Wed, 12 Jul 2023 16:25:30 +0300 Subject: [PATCH] #2242: ebnf job --- .github/workflows/ebnf.yml | 57 ++++++++++++++++++++++++++++++++++++++ .github/workflows/mvn.yml | 32 +-------------------- README.md | 4 ++- 3 files changed, 61 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/ebnf.yml diff --git a/.github/workflows/ebnf.yml b/.github/workflows/ebnf.yml new file mode 100644 index 0000000000..fb5af6a320 --- /dev/null +++ b/.github/workflows/ebnf.yml @@ -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/setup-texlive-action@v2.5.1 + 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/github-pages-deploy-action@v4.4.1 + with: + branch: gh-pages + folder: eo-parser/target/gh-pages + clean: false + if: github.ref == 'refs/heads/master' diff --git a/.github/workflows/mvn.yml b/.github/workflows/mvn.yml index 2c1d9f8112..41af491c8a 100644 --- a/.github/workflows/mvn.yml +++ b/.github/workflows/mvn.yml @@ -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/setup-texlive-action@v2.5.1 - with: - update-all-packages: true - packages: scheme-basic naive-ebnf - uses: actions/setup-java@v3 with: distribution: 'temurin' @@ -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/github-pages-deploy-action@v4.4.1 - with: - branch: gh-pages - folder: eo-parser/target/gh-pages - clean: false - if: github.ref == 'refs/heads/master' && matrix.os == 'ubuntu-20.04' diff --git a/README.md b/README.md index 9d0566c01a..b9e5e70ecd 100644 --- a/README.md +++ b/README.md @@ -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): ENBF of EO +The image was [auto-generated](). + ## What's Next? Join [our Telegram group](https://t.me/polystat_org).