Skip to content

CI unit tests

CI unit tests #298

# This is a basic workflow to help you get started with Actions
name: continuous integration
# trigger action on all branches, pull requests and tags
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
test:
# The type of runner that the job will run on
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