Skip to content

ignore warnings when installing dependencies...do not treat them as e… #350

ignore warnings when installing dependencies...do not treat them as e…

ignore warnings when installing dependencies...do not treat them as e… #350

name: CLI CI
on:
workflow_dispatch:
# Run on weeknights, and also whenever a push is made
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 }}
# RUBYLIB: /usr/local/openstudio-3.7.0/Ruby
UO_NUM_PARALLEL: 4
# GHA machines have 4 cores. Trying to run more concurrently will slow everything down.
# https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/
jobs:
weeknight-tests:
strategy:
matrix:
# os: container operations in GHA only work on Ubuntu
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
simulation-type: [basic, GHE, GEB, residential, electric]
runs-on: ubuntu-latest
container:
image: docker://nrel/openstudio:3.7.0
steps:
- uses: actions/checkout@v4
# - name: Download and Install OpenStudio
# run: |
# wget -q https://github.com/NREL/OpenStudio/releases/download/v3.7.0/OpenStudio-3.7.0+d5269793f1-Ubuntu-22.04-x86_64.deb
# sudo apt install -y ./OpenStudio-3.7.0+d5269793f1-Ubuntu-22.04-x86_64.deb
# openstudio openstudio_version
# which openstudio
# echo "export RUBYLIB='/usr/local/openstudio-3.7.0/Ruby'" >> ~/.bashrc
# source ~/.bashrc
- name: Change Owner of Container Working Directory
# working dir permissions workaround from https://github.com/actions/runner-images/issues/6775s#issuecomment-1377299658
run: |
chown root:root .
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
# with:
## limits ssh access and adds the ssh public key for the user which triggered the workflow
# limit-access-to-actor: true
## limits ssh access and adds the ssh public keys of the listed GitHub users
# limit-access-to-users: vtnate, kflemin
# ## If no one connects after 5 minutes, shut down server.
# wait-timeout-minutes: 5
- name: Install Ruby dependencies
run: |
which ruby
ruby --version
bundle update
bundle exec certified-update
- name: Install python dependencies
if: ${{ matrix.simulation-type == 'electric' || matrix.simulation-type == 'GHE' }}
run: bundle exec rspec -e 'Install python dependencies'
- name: Test project setup
# We only need to run these tests once, not every matrix iteration.
if: ${{ matrix.simulation-type == 'basic' }}
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'
- 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
# Using v4 would mean we have to change our path design, and/or the test dir names
# Only upload if a previous step fails
if: failure()
with:
name: rspec_results
path: artifact.zip
retention-days: 7 # save for 1 week then delete