Skip to content

bug fix "[latexindent.exe] -GCString switch cannot run normally" #91

bug fix "[latexindent.exe] -GCString switch cannot run normally"

bug fix "[latexindent.exe] -GCString switch cannot run normally" #91

name: latexindent.pl run test-cases/test-cases.sh if key files changed
# PURPOSE:
#
# run
#
# ./test-cases/test-cases.sh
#
# Notes:
#
# (1) this action only runs on DEVELOP branch, there's
# no need to run it on the main branch nor on
# experimental feature branches
#
# (2) this action only runs when when at least one of
#
# latexindent.pl
# defaultSettings.yaml
# LatexIndent/*.pm
#
# have been changed since the last commit
#
# references
# https://github.com/tj-actions/changed-files
on:
pull_request:
branches:
- develop
jobs:
check-pm-files-changed:
name: latexindent.pl check if latexindent.pl, defaultSettings.yaml, .pm files changed
runs-on: ubuntu-latest
outputs:
anychanged: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files, latexindent.pl
id: changed-files
uses: tj-actions/changed-files@v43
with:
files: |
latexindent.pl
defaultSettings.yaml
LatexIndent/*.pm
- if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
name: List all relevant changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file has changed compared to main branch"
done
- if: ${{ steps.changed-files.outputs.any_changed == 'false' }}
name: No perl based files have changed
run: |
echo ""
echo "none of latexindent.pl, defaultSettings.yaml, LatexIndent/*.pm have changed since last commit"
echo "no need to run the rest of batch-check.yaml :)"
echo ""
latexindent-test-cases:
needs: check-pm-files-changed
if: ${{fromJSON(needs.check-pm-files-changed.outputs.anychanged)}}
runs-on: ubuntu-latest
name: test-cases.sh check as perl related files changed
steps:
# install Perl
#
# https://github.com/marketplace/actions/setup-perl-environment
- name: installing Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: 5.34
- name: installing perl modules for latexindent.pl
run: |
cpanm YAML::Tiny
cpanm File::HomeDir
cpanm Unicode::GCString
# checkout github.com/cmhughes/latexindent.pl
#
# https://github.com/actions/checkout
- name: Loading the "base actions/checkout" so as to access latexindent.pl
uses: actions/checkout@v4
- name: run test-cases/test-cases.sh
shell: bash
run: |
chmod +x latexindent.pl
cp latexindent.pl /usr/local/bin
cp -r LatexIndent /usr/local/bin
cp defaultSettings.yaml /usr/local/bin
cd test-cases/
sed -i.bak "s/function checkgitdiff/function checkgitdiffcmh/" test-cases.sh
sed -i.bak "s/checkgitdiff//" test-cases.sh
./test-cases.sh -s
- name: Check for changed files in test-cases
uses: tj-actions/changed-files@v43
id: changed-files
with:
files: |
test-cases/
- if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
name: List all changed files from test-cases
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file has changed on this pull request"
done
- if: ${{ steps.changed-files.outputs.any_changed == 'false' }}
name: No test-cases files have changed
run: |
echo ""
echo "none of test-cases have changed on this pull request,"
echo "full review still needed, but this is a good sign :)"
echo ""