From 476f2639728738d353ec11addd93a4ec0c47b165 Mon Sep 17 00:00:00 2001 From: Martin Scheidt Date: Wed, 9 Feb 2022 14:09:41 +0100 Subject: [PATCH] added github action 'debug' --- .github/workflows/debug.yml | 43 +++++++++++++++++++++++++++++++++++ .github/workflows/testing.yml | 16 ++++++++----- dev-install.sh | 10 +++++--- test/testing.sh | 8 +++---- 4 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/debug.yml diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml new file mode 100644 index 0000000..d488ca4 --- /dev/null +++ b/.github/workflows/debug.yml @@ -0,0 +1,43 @@ +# This is a basic workflow to help you get started with Actions + +name: debug + +# Controls when the workflow will run +on: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + debug: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # - name: "install TeXLive" + # # Actually pick a version, do not point on master, or the build won't be reproducible + # uses: DanySK/setup-texlive-action@master + # # You can omit the following if the default path is ok with you + # with: + # requirements-file: .github/texlive/requirements.txt + - name: "Setup TeX Live" + uses: teatimeguest/setup-texlive-action@v1 + with: + package-file: .github/texlive/requirements.txt + + - name: "checkout" + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + uses: actions/checkout@v2 + + - name: "install tikz-trackschematic" + run: | + chmod +x dev-install.sh + ./dev-install.sh -b + + - name: Setup upterm session + uses: lhotari/action-upterm@v1 + with: + ## limits ssh access and adds the ssh public keys of the listed GitHub users + limit-access-to-users: railtoolkit,kaat0 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 40963b9..fdd77f0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -20,12 +20,16 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: "install TeXLive" - # Actually pick a version, do not point on master, or the build won't be reproducible - uses: DanySK/setup-texlive-action@master - # You can omit the following if the default path is ok with you + # - name: "install TeXLive" + # # Actually pick a version, do not point on master, or the build won't be reproducible + # uses: DanySK/setup-texlive-action@master + # # You can omit the following if the default path is ok with you + # with: + # requirements-file: .github/texlive/requirements.txt + - name: "Setup TeX Live" + uses: teatimeguest/setup-texlive-action@v1 with: - requirements-file: .github/texlive/requirements.txt + package-file: .github/texlive/requirements.txt - name: "checkout" # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -34,7 +38,7 @@ jobs: - name: "install tikz-trackschematic" run: | chmod +x dev-install.sh - ./dev-install.sh -q + ./dev-install.sh -b - name: "test tikz-trackschematic" run: | diff --git a/dev-install.sh b/dev-install.sh index dea5104..f23b9c6 100755 --- a/dev-install.sh +++ b/dev-install.sh @@ -8,14 +8,18 @@ set -e ## -- pass getopts -usage() { echo "Usage: dev-install.sh [-q]"; } +usage() { echo "Usage: dev-install.sh [-q] [-b]"; } verbose=1 +batch_mode=0 -while getopts ":q" opt; do +while getopts ":qb" opt; do case ${opt} in q ) verbose=0 ;; + b ) batch_mode=1 + verbose=0 + ;; \? ) usage exit 1 ;; @@ -79,7 +83,7 @@ DEVDIR="tex/latex/tikz-trackschematic-dev" PROJECTDIR=$(pwd -P) -if [ "$verbose" -eq 1 ]; then +if [ "$batch_mode" -eq 0 ]; then echo "" echo "Do you wish to link this package from" echo "$PROJECTDIR/src to" diff --git a/test/testing.sh b/test/testing.sh index 9f10a50..98db364 100755 --- a/test/testing.sh +++ b/test/testing.sh @@ -49,13 +49,13 @@ check_trackschematic() { ls $TEXMFLOCAL/$DEVDIR/tikz-trackschematic.sty >> /dev/null 2>&1 || status=1 if [ $status = 0 ]; then if [ "$verbose" -eq 1 ]; then - echo "tikz-trackschematic found" + echo "tikz-trackschematic-dev found" fi return 0 fi - echo "Library 'tikz-trackschematic' not found." - echo "Be sure to have tikz-trackschematic installed!" + echo "Library 'tikz-trackschematic-dev' not found." + echo "Be sure to have tikz-trackschematic-dev installed!" exit 1 } @@ -87,7 +87,7 @@ for TEST in $1*.tex; do if [ "$verbose" -eq 1 ]; then echo "Testing: ${TEST%.*}" fi - pdflatex -output-directory=.testing -interaction=batchmode -halt-on-error $TEST # 2>&1 > /dev/null + pdflatex -output-directory=.testing -interaction=batchmode -halt-on-error $TEST 2>&1 > /dev/null compare -metric DSSIM -colorspace RGB .testing/${TEST%.*}.pdf ${TEST%.*}_expected.pdf .testing/${TEST%.*}_diff.png if [ "$verbose" -eq 1 ]; then echo "% difference"