Skip to content

another attempt at setting the safe.directory properly #82

another attempt at setting the safe.directory properly

another attempt at setting the safe.directory properly #82

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: [ubuntu-latest]
simulation-type: [basic, GEB, residential, electric]
# python-version: ["3.10"]
# runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
container:
image: docker://nrel/openstudio:3.6.1
steps:
- uses: actions/checkout@v4
- name: Change Owner of Container Working Directory
# git ownership workaround from https://github.com/actions/runner-images/issues/6775#issuecomment-1377299658
run: chown root:root .
- name: Set up Python
uses: actions/setup-python@v4
with:
# Disco needs python 3.10
python-version: '3.10'
- name: Install Ruby dependencies
run: |
ruby --version
bundle update
bundle exec certified-update
- name: Install Python dependencies
run: |
if ${{ matrix.simulation-type }} == electric ; then
bundle exec uo install_python
fi
- name: Test project setup
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 rspec fails
if: failure()
with:
name: rspec_results
path: |
spec/test_directory**/
# coverage/
retention-days: 7 # save for 1 week before deleting