Skip to content

Commit

Permalink
Merge pull request #3 from nasa/HARMONY-816
Browse files Browse the repository at this point in the history
Harmony 816
  • Loading branch information
bilts authored May 13, 2021
2 parents 79a257c + a805db0 commit c6e09ca
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/github-actions.yml
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 }}/*

0 comments on commit c6e09ca

Please sign in to comment.