Python package #1582
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python package | |
on: | |
schedule: | |
- cron: "0 0 1,10,20 * *" | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
lint: | |
uses: ./.github/workflows/lint.yaml | |
build: | |
runs-on: ${{ matrix.os }} | |
needs: [lint] | |
timeout-minutes: 180 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.8] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install -r requirements.txt | |
pip3 install -r requirements-dev.txt | |
#- name: Typilus, Suggest Python Type Annotations | |
# uses: typilus/typilus-action@v0.9 | |
- name: Run unittests | |
id: unittests | |
continue-on-error: true | |
run: | | |
coverage run -m unittest -v test_module.TestScholarly | |
- name: Generate coverage report (macOS only) | |
if: | |
"matrix.os == 'macos-latest'" | |
run: | | |
curl --data-binary @.github/.codecov.yml https://codecov.io/validate | head -n 1 | |
coverage xml | |
- name: Upload code coverage (macOS only) | |
if: | |
"matrix.os == 'macos-latest'" | |
uses: codecov/codecov-action@v2 | |
with: | |
directory: ./ | |
fail_ci_if_error: false | |
files: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
verbose: true | |
- name: Check if unittests failed | |
if: "steps.unittests.outcome == 'failure'" | |
run: exit 1 |