-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from nasa/HARMONY-816
Harmony 816
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# This workflow will install python dependencies, run tests, | ||
# and report test results and code coverage as artifacts. | ||
|
||
name: Github actions | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build_and_test: | ||
|
||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [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 --upgrade pip | ||
pip install -r requirements/core.txt -r requirements/dev.txt | ||
- name: Run test | ||
run: | | ||
bin/test >& test_results-${{ matrix.python-version }}.txt | ||
- name: Generate coverage report | ||
if: ${{ always() }} | ||
run: | | ||
coverage report -m >& coverage_report-${{ matrix.python-version }}.txt | ||
coverage html --dir htmlcov-${{ matrix.python-version }} | ||
- name: Archive test results | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test result (for python ${{ matrix.python-version }}) | ||
path: test_results-${{ matrix.python-version }}.txt | ||
|
||
- name: Archive code coverage report (plain text) | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: code coverage report (plain text) (for python ${{ matrix.python-version }}) | ||
path: coverage_report-${{ matrix.python-version }}.txt | ||
|
||
- name: Archive code coverage report (html) | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: code coverage report (html) (for python ${{ matrix.python-version }}) | ||
path: htmlcov-${{ matrix.python-version }}/* |