Create out dir #36
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
name: Example Dataset Test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-12, macos-latest, windows-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Run Release | |
run: | | |
java -jar AcrosticSleuth.jar -input data/demo -language EN -mode LINE -charset utf-8 -outputSize 4000 --concise > result.tsv | |
- name: Test Release on Mac or Ubuntu | |
if: matrix.os != 'windows-latest' | |
run: | | |
diff -w result.tsv .github/workflows/exampleExpectedResult.tsv | |
- name: Test Release on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
(Get-Content result.tsv) -replace '\\', '/' | Set-Content result_normalized.tsv | |
(Get-Content .github\workflows\exampleExpectedResult.tsv) -replace '\\', '/' | Set-Content exampleExpectedResult_normalized.tsv | |
(Get-Content result_normalized.tsv) -replace '^\s+|\s+$', '' -replace '\s+', ' ' | Sort-Object | Set-Content result_sorted.tsv | |
(Get-Content exampleExpectedResult_normalized.tsv) -replace '^\s+|\s+$', '' -replace '\s+', ' ' | Sort-Object | Set-Content exampleExpectedResult_sorted.tsv | |
fc.exe result_sorted.tsv exampleExpectedResult_sorted.tsv | |
- name: Build From Source and Run | |
run: | | |
javac -d out -cp src src/acrosticsleuth/*.java | |
jar cfe AcrosticSleuth.jar acrosticsleuth.Main -C out . -C models . | |
java -jar AcrosticSleuth.jar -input data/demo -language EN -mode LINE -charset utf-8 -outputSize 4000 --concise > result.tsv | |
- name: Test Build on Mac or Ubuntu | |
if: matrix.os != 'windows-latest' | |
run: | | |
diff -w result.tsv .github/workflows/exampleExpectedResult.tsv | |
- name: Test Build on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
(Get-Content result.tsv) -replace '\\', '/' | Set-Content result_normalized.tsv | |
(Get-Content .github\workflows\exampleExpectedResult.tsv) -replace '\\', '/' | Set-Content exampleExpectedResult_normalized.tsv | |
(Get-Content result_normalized.tsv) -replace '^\s+|\s+$', '' -replace '\s+', ' ' | Sort-Object | Set-Content result_sorted.tsv | |
(Get-Content exampleExpectedResult_normalized.tsv) -replace '^\s+|\s+$', '' -replace '\s+', ' ' | Sort-Object | Set-Content exampleExpectedResult_sorted.tsv | |
fc.exe result_sorted.tsv exampleExpectedResult_sorted.tsv |