-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
32 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,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' |
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 |
---|---|---|
|
@@ -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' | ||
|
@@ -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' |
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