Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #154 from NREL/github_actions
Browse files Browse the repository at this point in the history
Adding github workflow for CI
  • Loading branch information
nmerket authored Jul 2, 2021
2 parents 8c2faf2 + ae31cbb commit ad09fcd
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 76 deletions.
74 changes: 0 additions & 74 deletions .circleci/config.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[run]
omit =
hescorehpxml/create_all_example_json.py
hescorehpxml/__main__.py
60 changes: 60 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Tests
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- 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 --progress-bar off --upgrade pip
pip install --progress-bar off setuptools wheel
pip install --progress-bar off ".[test]"
- name: Linting
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --max-line-length=127 --statistics
- name: Run Tests and Coverage Report
run: pytest --junitxml=coverage/junit.xml --cov=hescorehpxml --cov-report=xml:coverage/coverage.xml --cov-report=html:coverage/htmlreport
continue-on-error: true
- name: Test Report
uses: mikepenz/action-junit-report@v2.4.3
if: ${{ matrix.python-version == 3.9 }}
with:
report_paths: coverage/junit.xml
check_name: Testing Report
fail_on_failure: true
- name: Save Coverage Report
uses: actions/upload-artifact@v2
if: ${{ matrix.python-version == 3.9 }}
with:
name: coverage-report-html
path: coverage/htmlreport/
- name: Report coverage to PR
uses: 5monkeys/cobertura-action@v9
if: ${{ matrix.python-version == 3.9 }}
with:
path: coverage/coverage.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
minimum_coverage: 83
- name: Build documentation
if: ${{ matrix.python-version == 3.9 }}
run: |
cd docs
make html
- name: Save Docs
uses: actions/upload-artifact@v2
if: ${{ matrix.python-version == 3.9 }}
with:
name: documentation
path: docs/build/html/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ dist
build
.env
.devcontainer
coverage
.coverage
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,17 @@
'sphinx',
'sphinx_rtd_theme',
'sphinx-autobuild',
'pytest'
'pytest',
'pytest-cov'
],
'test': [
'flake8',
'coverage',
'sphinx',
'sphinx_rtd_theme',
'sphinx-autobuild',
'pytest'
'pytest',
'pytest-cov'
]
},
include_package_data=True,
Expand Down

0 comments on commit ad09fcd

Please sign in to comment.