Skip to content

Commit

Permalink
Merge pull request #30 from urbanopt/gha
Browse files Browse the repository at this point in the history
Set up github actions with coveralls
  • Loading branch information
kflemin committed Mar 1, 2023
2 parents 4cfb161 + 1f8d6ed commit aa74f64
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 3 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

name: ci

on:
# push:
schedule:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
# 5:23 am UTC (11:23pm MDT the day before) every weekday night in MDT
- cron: '23 5 * * 2-6'

env:
# This env var should enforce develop branch of all dependencies
FAVOR_LOCAL_GEMS: true
GEM_DEVELOPER_KEY: ${{ secrets.GEM_DEVELOPER_KEY }}

jobs:
weeknight-tests:
runs-on: ubuntu-latest
container:
image: docker://nrel/openstudio:3.5.1
steps:
- uses: actions/checkout@v3
- name: Update gems
run: |
ruby --version
bundle update
bundle exec certified-update
- name: Run Rspec
continue-on-error: true
# Continue to upload step even if a test fails, so we can troubleshoot
run: bundle exec rspec
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: failure() # Only upload if rspec fails
with:
name: rspec_results
path: |
spec/test*/**
# coverage/
retention-days: 7 # save for 1 week before deleting
# coveralls action docs: https://github.com/marketplace/actions/coveralls-github-action
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./coverage/lcov/urbanopt-rnm-us-gem.lcov"
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![Coverage Status](https://coveralls.io/repos/github/urbanopt/urbanopt-rnm-us-gem/badge.svg?branch=develop)](https://coveralls.io/github/urbanopt/urbanopt-rnm-us-gem?branch=develop)

# URBANopt RNM-US Gem

The URBANopt<sup>&trade;</sup> RNM-US Gem includes functionalities to interface the URBANopt SDK to the RNM-US Gem for the development of a synthetic optimum distribution network in the considered district, given data related to the buildings energy consumption/DER energy generation and location, modeled by the other URBANopt modules.
The URBANopt<sup>&trade;</sup> RNM-US Gem includes functionalities to interface the URBANopt SDK to the RNM-US Gem for the development of a synthetic optimum distribution network in the considered district, given data related to the buildings energy consumption/DER energy generation and location, modeled by the other URBANopt modules.
The RNM-US Gem is used to collect required data for the execution of RNM-US, which has been modeled in the other URBANopt modules, translating information provided
in .json and .csv format into .txt files

Expand All @@ -15,7 +17,7 @@ The OpenDSS format presents results for power system analysis and simulations.
The current functionalities of the RNM-US Gem include the creation of a streetmap text file, the substation txt file and multiple txt files related to the consumers peak loads and profiles and DERs peak generation and profiles.
The streetmap text file is developed from coordinates information provided by geoJSON feature file input. The customers and generators text files, which define all the network consumers and DG included in the project, are created from their peak electricity demand/generation, and building location, provided by csv and json feature_report files modeled by the URBANopt Scenario Gem.
The profiles txt files are divided among the consumers hourly profiles of active and reactive power and the DG hourly profiles of active and reactive power for the 2 most "extreme" days of maximum net demand and maximum net generation for the district .
Finally, the extended profiles txt files provide the active and reactive profiles for each consumer/DG for the whole year.
Finally, the extended profiles txt files provide the active and reactive profiles for each consumer/DG for the whole year.


## Generate input files
Expand Down Expand Up @@ -67,4 +69,4 @@ The validation and results visualization functionality is written in python. Fol

```bash
bundle exec rspec
```
```
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
# *********************************************************************************

require 'simplecov'
require 'simplecov-lcov'

SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
# Don't consider the spec folder for test coverage reporting (inside the do/end loop)
SimpleCov.start do
add_filter '/spec/'
end

require 'bundler/setup'
require 'urbanopt/rnm'

Expand Down
2 changes: 2 additions & 0 deletions urbanopt-rnm-us-gem.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop', '~> 1.15.0'
spec.add_development_dependency 'rubocop-checkstyle_formatter', '~> 0.4.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.11.3'
spec.add_development_dependency 'simplecov', '~> 0.18.2'
spec.add_development_dependency 'simplecov-lcov', '~> 0.8.0'
end

0 comments on commit aa74f64

Please sign in to comment.