Skip to content

use patched ditto-reader #152

use patched ditto-reader

use patched ditto-reader #152

name: CLI CI
on:
push:
# schedule:
# # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
# # 5:24 am UTC (11:24pm MDT the day before) every weekday night in MDT
# - cron: '24 5 * * 2-6'
# pull_request:
# types: [review_requested]
env:
# Favor_Local_Gems enforces develop branch of all Ruby dependencies
# This is our canary in the coal mine! If any simulation tests fail, comment this and retry.
# If CI is then successful, we have a breaking change in a dependency somewhere.
# FAVOR_LOCAL_GEMS: true
GEM_DEVELOPER_KEY: ${{ secrets.GEM_DEVELOPER_KEY }}
UO_NUM_PARALLEL: 2
# GHA machines only have 2 cores. Trying to run more than that is even slower.
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
jobs:
weeknight-tests:
strategy:
matrix:
# os: container operations in GHA only work on Ubuntu
simulation-type: [electric] # basic, GEB, residential,
# python-version: No need to test more than 1 python-version
runs-on: ubuntu-latest
container:
image: docker://nrel/openstudio:3.6.1
steps:
- uses: actions/checkout@v4
- name: Change Owner of Container Working Directory
# working dir permissions workaround from https://github.com/actions/runner-images/issues/6775#issuecomment-1377299658
run: chown root:root .
- name: Set up Python
if: ${{ matrix.simulation-type == 'electric' }}
uses: actions/setup-python@v5
with:
# Disco needs python ~=3.10
python-version: '3.10'
- name: Install Ruby dependencies
run: |
ruby --version
bundle update
bundle exec certified-update
- name: Test project setup
# We only need to run these tests once, not every matrix iteration.
if: ${{ matrix.simulation-type == 'electric' }}
run: |
bundle exec rspec -e 'Admin'
bundle exec rspec -e 'Create project'
bundle exec rspec -e 'Make and manipulate ScenarioFiles'
bundle exec rspec -e 'Update project directory'
bundle exec rspec -e 'Install python dependencies'
- name: Test simulations
run: bundle exec rspec -e 'Run and work with a small ${{ matrix.simulation-type }} simulation'
- name: Upload artifacts
# Save results for examination - useful for debugging
uses: actions/upload-artifact@v3
# Only upload if a previous step fails
if: failure()
with:
name: rspec_results
path: |
spec/test_directory**/
# coverage/
retention-days: 7 # save for 1 week before deleting