diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 00000000..ff5c7e62 --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,26 @@ +name: Unit test run + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements_pip.txt ]; then pip install -r requirements_pip.txt; fi + - name: Test with pytest + run: python -m coverage run --branch --source=onair -m pytest ./test/ + - name: Coverage report + run: coverage report + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 diff --git a/README.md b/README.md index 87733b71..854acee4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +![Build](https://github.com/nasa/OnAIR/actions/workflows/unit-test.yml/badge.svg) +[![CodeCov](https://codecov.io/gh/nasa/OnAIR/branch/main/graph/badge.svg?token=L0WVOTD5X9)](https://codecov.io/gh/nasa/OnAIR) + # The On-board Artificial Intelligence Research (OnAIR) Platform The On-board Artificial Intelligence Research (OnAIR) Platform is a framework that enables AI algorithms written in Python to interact with NASA's [cFS](https://github.com/nasa/cFS).