Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More CI - run pytest in github action #95

Merged
merged 3 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push, pull_request]

jobs:
lint:
if: "!contains(github.event.head_commit.message, 'skip_ci')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run pytest

on: [push]

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip_ci')"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this line work? Does it test on each of these versions of python?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that basically creates 3 separate jobs, each with a different value of ${{ matrix.python-version }} which is up to us to use accordingly, in this case by passing it to relevant steps/commands. Some docs if you're interested.


steps:
- name: Checkout PreREISE
uses: actions/checkout@v2
with:
path: PreREISE
- name: Checkout PowerSimData
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's possible to include a newline between each step, that would probably make it more readable

uses: actions/checkout@v2
with:
repository: intvenlab/PowerSimData
token: ${{ secrets.CI_TOKEN_CLONE_REPO }}
path: PowerSimData
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --python=${{ matrix.python-version }}
working-directory: PreREISE
- name: Test with pytest
run: |
pipenv run pytest . -m 'not integration'
working-directory: PreREISE
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
![Pytest](https://github.com/intvenlab/PreREISE/workflows/Run%20pytest/badge.svg)

# PreREISE
This package gathers and builds demand, hydro, solar, and wind profiles. The
Expand Down