Skip to content

Commit

Permalink
Merge pull request #51 from NREL/env_workflow
Browse files Browse the repository at this point in the history
Create workflows for repo
  • Loading branch information
michaelavs authored Dec 5, 2024
2 parents 1597d79 + 937cbb7 commit ebff69c
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 10 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI
on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * *' # Daily “At 00:00”
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: checkout
uses: actions/checkout@v4
- name: set environment variables
run: |
echo "TODAY=$(date +%Y-%m-%d)" >> $GITHUB_ENV
- name: environment setup
id: env-setup
continue-on-error: true
uses: conda-incubator/setup-miniconda@v3 # Use miniconda as conda action has issue with macos-latest
with:
environment-file: build_envs/environment.yml

- name: retry environment set up if failed
if: steps.env-setup.outcome == 'failure'
uses: mamba-org/setup-micromamba@v2 # If miniconda fails, use mamba as backup option
with:
download-micromamba: true
environment-file: build_envs/environment.yml
cache-environment: true
cache-environment-key: "CI ${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}"
create-args: >-
python=${{matrix.python-version}}
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<p align="center">
| CI | [![GitHub Workflow Status][github-ci-badge]][github-ci-link] |
| :----------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| **Docs** | [![Documentation Status][rtd-badge]][rtd-link] |
| **Version** | [![Version][version-badge]][version-link] |


<p align="center">
<img src="https://github.com/NREL/dgen/blob/master/docs/figs/dGen-logo-lrg.png" />
</p>

The Distributed Generation Market Demand (dGen) Model
=====================================================

<p align="center">
<a href="https://github.com/NREL/dgen/releases/latest">
<img src="https://img.shields.io/github/v/release/NREL/dgen">
</a>
<a href="https://nrel.github.io/dgen/">
<img src="https://img.shields.io/badge/docs-ready-blue.svg">
</a>
</p>


## Documentation
- [Webinar and Setup Tutorial](https://youtu.be/-Te5_KKZR8o)
Expand Down Expand Up @@ -201,3 +198,10 @@ Notes:

## Notes:
- The "load_path" variable in config.py from the beta release has been removed for the final release. The load data is now integrated into each database. Load data and meta data for the agents is still accessible via the OEDI data submission.

[github-ci-badge]: https://img.shields.io/github/actions/workflow/status/NREL/dgen/ci.yml?branch=master&style=for-the-badge&label=CI
[github-ci-link]: https://github.com/NREL/dgen/actions/workflows/ci.yml
[rtd-badge]: https://img.shields.io/badge/docs-ready-blue.svg
[rtd-link]: https://nrel.github.io/dgen/
[version-link]: https://github.com/NREL/dgen/releases/latest
[version-badge]: https://img.shields.io/github/v/release/NREL/dgen
21 changes: 21 additions & 0 deletions build_envs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: dg3n_build
channels:
- conda-forge
- nrel
dependencies:
- colorama
- colorlog
- requests
- matplotlib
- numpy
- openpyxl
- pandas
- pip
- psutil
- psycopg2
- scipy
- spyder
- sqlalchemy
- nrel-pysam=4.2.0
- pip:
- nrel-pysam-stubs

0 comments on commit ebff69c

Please sign in to comment.