diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml new file mode 100644 index 00000000..7fb8faa2 --- /dev/null +++ b/.github/workflows/Test.yml @@ -0,0 +1,32 @@ +name: Test + +on: push + +jobs: + test-std140: + name: Test std140 + runs-on: windows-2022 + defaults: + run: + shell: pwsh + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install python dependencies + run: pip install openpyxl numpy pandas matplotlib mako + - name: Download modelkit # Install modelkit + run: curl -o modelkit-installer.exe https://share.bigladdersoftware.com/files/modelkit-caboodle-0.9.0-flannel+caboodle.22.a701d43.exe + - name: Install modelkit + run: .\modelkit-installer.exe /SP- /VERYSILENT /DIR=modelkit-folder | Out-Null + - name: Add modelkit to path + run: | + "${{ github.workspace }}\modelkit-folder\bin" >> $env:GITHUB_PATH + - name: Run section-5 test + run: modelkit rake sim[section-5] + - name: Run weather-drivers test + run: modelkit rake sim[weather-drivers] + - name: Upload report + uses: actions/upload-artifact@v3 + with: + name: reports + path: ./reports/ diff --git a/Rakefile b/Rakefile index fda6f32d..1f554bd7 100644 --- a/Rakefile +++ b/Rakefile @@ -20,7 +20,7 @@ def compose(c, tests) success = nil if !(FileUtils.uptodate?(target, src)) puts "\ncomposing...\n\n" - success = system(%Q|modelkit template-compose -f "#{c}" -o "#{output_dir + '/in.cse'}" base-#{tests}.pxt|) + success = system(%Q| echo base-#{tests}.pxt \| modelkit template-compose -f "#{c}" -o "#{output_dir + '/in.cse'}" |) else puts " ...input already up-to-date." success = true @@ -82,17 +82,14 @@ task :sim, [:filter] do |t, args| cases = Dir['cases/' + tests + '/*.*'] for c in cases if !compose(c, tests) - puts "\nERROR: Composition failed..." - exit + abort("\nERROR: Composition failed...") end if !sim(c, tests) - puts "\nERROR: Simulation failed..." - exit + abort("\nERROR: Simulation failed...") end end if !write_report(tests) - puts "\nERROR: Failed to generate reports..." - exit + abort("\nERROR: Failed to generate reports...") end end