diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2cf2e42..7696a21 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,13 +10,23 @@ on: # 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 "parse" - parse: + # This workflow contains a single job called "syntax_check" + syntax_checks: + timeout-minutes: 5 runs-on: ubuntu-latest - container: openmodelica/moparser - # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Checkout + - name: Checkout code uses: actions/checkout@v4 - - name: Parse the library - run: moparser -v 3.6 -r Chemical + with: + fetch-depth: 5 + - name: Get moparser + run: git clone --depth=1 https://github.com/modelica-tools/ModelicaSyntaxChecker + - name: Check file encoding + run: "! find . -name '*.mo' -exec bash -c 'iconv -o /dev/null -f utf8 -t utf8 \"{}\" |& sed \"s,^,{}: ,\"' ';' | grep '.'" + - name: Check for UTF-8 BOM + run: "! find . -name '*.mo' -print0 | xargs -0 grep -l $'^\\xEF\\xBB\\xBF' | grep ." + - name: Check syntax + run: | + echo "::add-matcher::./.github/moparser.json" + ModelicaSyntaxChecker/Linux64/moparser -v 3.6 -r Chemical + echo "::remove-matcher owner=moparser::"