Unittest #664
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
name: Unittest | |
on: | |
push: | |
pull_request: | |
branches: | |
- develop | |
- feature/** | |
schedule: | |
- cron: "0 0 * * 0" # weekly | |
jobs: | |
unit_tests: | |
name: Unit Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: [3.9, "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: "pyproject.toml" | |
- name: Python Packages Install | |
run: | | |
python -m pip install --upgrade pip # upgrade pip | |
pip install wheel | |
pip install .[skl,stats,test] codacy-coverage | |
- name: Test Windows | |
if: runner.os == 'Windows' | |
env: | |
MPLBACKEND: Agg | |
run: pytest | |
- name: Test MacOS | |
if: runner.os == 'macOS' | |
run: pytest | |
- name: Prep Linux | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install jq curl # codacy requirement | |
sudo apt-get install xvfb | |
- name: Test Linux | |
if: runner.os == 'Linux' | |
run: | | |
xvfb-run pytest | |
- name: Coveralls | |
env: | |
COVERALLS_SERVICE_NAME: github | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: ${{ matrix.test-name }} | |
COVERALLS_PARALLEL: true | |
run: | | |
coveralls | |
coveralls: | |
name: Indicate completion to coveralls.io | |
needs: unit_tests | |
if: success() || failure() | |
runs-on: ubuntu-latest | |
container: python:3-slim | |
steps: | |
- name: Finished | |
run: | | |
pip3 install --upgrade coveralls | |
coveralls --finish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |