Skip to content

Example-project CI

Example-project CI #47

Workflow file for this run

name: weekly_build
on:
# push:
schedule:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
# 5 am UTC (11pm MDT the day before) every weekday night in MDT
- cron: '* 5 * * 0'
env:
# This env var should enforce develop branch of all dependencies
FAVOR_LOCAL_GEMS: true
GEM_DEVELOPER_KEY: ${{ secrets.GEM_DEVELOPER_KEY }}
jobs:
simulate-and-post-process:
# ubuntu-latest works since https://github.com/rbenv/ruby-build/releases/tag/v20220710 (July 10, 2022)
# https://github.com/rbenv/ruby-build/discussions/1940
strategy:
matrix:
scenario: [baseline, chilled_water_storage, flexible_hot_water, high_efficiency, mixed,
peak_hours_mels_shedding, peak_hours_thermostat_adjust, reopt, thermal_storage]
runs-on: ubuntu-latest
container:
image: docker://nrel/openstudio:3.6.1
steps:
- uses: actions/checkout@v3
- name: Update gems
run: |
bundle update
bundle exec certified-update
- name: Simulate
# Continue to upload step even if a test fails, so we can troubleshoot
# continue-on-error: true
run: bundle exec rake run_${{ matrix.scenario }}
- name: Post process
# continue-on-error: true
run: bundle exec rake post_process_${{ matrix.scenario }}
- 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: example_project/run/*scenario/
retention-days: 7 # save for 1 week before deleting