diff --git a/.github/workflows/latex-three-os.yml b/.github/workflows/latex-three-os.yml index 0776e38..f9fcd77 100644 --- a/.github/workflows/latex-three-os.yml +++ b/.github/workflows/latex-three-os.yml @@ -11,7 +11,6 @@ defaults: jobs: run-on-three-os: - if: false strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] @@ -40,7 +39,7 @@ jobs: fi echo "os_null=$OS_NULL" >> $GITHUB_ENV - # env.unique_id + # env.artifact_id OS_SHORT=${{ matrix.os }} OS_SHORT=${OS_SHORT/-latest/} SHA1_SHORT=$(git rev-parse --short HEAD) @@ -49,27 +48,18 @@ jobs: else ID="$OS_SHORT-$SHA1_SHORT-${{ github.run_attempt }}" fi - echo "unique_id=$ID" >> $GITHUB_ENV + echo "artifact_id=$ID" >> $GITHUB_ENV - # - name: Run example(s) - # working-directory: latex-examples - # run: | - # # ENGINES=("pdflatex" "lualatex") - # ENGINES=("pdflatex") - # for engine in ${ENGINES[@]}; do - # $engine l3benchmark-gh1182*.tex # > "${{ env.os_null }}" - # # use "%0A" to throw a multiline warning - # # https://github.com/actions/toolkit/issues/193#issuecomment-605394935 - # log_filtered=$(\ - # grep -rh "seconds\|\[debug\] " *.log | \ - # awk 'BEGIN {RS=""}{gsub(/\n/,"%0A",$0); print $0}' \ - # ) - # # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message - # echo "::warning file=l3benchmark-gh1182-$engine*.log,line=1,col=1,endColumn=2::$log_filtered" - # done + - name: Test lua `io.write()` + shell: bash + working-directory: lua + run: | + texlua eol.lua + for file in `ls *.txt`; do echo $file; xxd $file; done - # - name: Archive - # uses: actions/upload-artifact@v3 - # with: - # name: latex-examples-${{ env.unique_id }} - # path: latex-examples + - name: Archive + uses: actions/upload-artifact@v3 + with: + name: lua-eol-${{ env.artifact_id }} + path: | + lua/*.txt diff --git a/lua/eol.lua b/lua/eol.lua new file mode 100644 index 0000000..f232c0f --- /dev/null +++ b/lua/eol.lua @@ -0,0 +1,12 @@ +local function test_eol(fname, content) + -- open file in binary mode, to avoid convertion from \n to \r\n in Win + -- http://lua-users.org/lists/lua-l/2015-05/msg00349.html + local file = io.open(fname, "wb") + io.output(file) + io.write(content) + io.close(file) +end + +test_eol("eol-crlf.txt", "abc\r\nabc\r\n") +test_eol("eol-lf.txt", "abc\nabc\n") +test_eol("eol-mixed.txt", "abc\r\nabc\n")