CI unit tests dashboard #311
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
# This is a basic workflow to help you get started with Actions | |
name: continuous integration | |
on: | |
pull_request: | |
branches: | |
- develop | |
- master | |
jobs: | |
tests-unit: | |
runs-on: ubuntu-latest | |
container: | |
image: nrel/openstudio:3.8.0 | |
steps: | |
- uses: actions/checkout@v4 | |
- run: openstudio classic measure --run_tests measures | |
# NOTE using this simpler action instead of https://github.com/actions/deploy-pages | |
- uses: peaceiris/actions-gh-pages@v4 | |
if: failure() || success() | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./measures/test_results/dashboard | |
test: | |
# needs: tests-unit | |
runs-on: ubuntu-latest | |
container: | |
image: nrel/openstudio:3.8.0 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install node and test | |
shell: bash | |
run: | | |
echo "installing node v16" | |
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - | |
apt update && apt install -y nodejs | |
node -v | |
npm -v | |
- name: install npm dependencies | |
shell: bash | |
run: | | |
cd test/regression | |
echo "install dependencies" | |
npm install | |
- name: run tests | |
shell: bash | |
run: | | |
cd test/regression | |
echo "run quick tests" | |
npm run start_subset | |
- name: run stats, display and check for failures | |
shell: bash | |
run: | | |
cd test/regression | |
echo "run stats" | |
npm run stats | |
filename=$(ls stats*.csv) | |
cat $filename | |
# Simple check to see if failure in stats file | |
if [ "$(grep -c "Fail" $filename)" -ge 1 ]; then | |
exit 1; | |
fi | |