GH Actions CI #143
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: GH Actions CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
# 3 am Tuesdays and Fridays | |
- cron: "0 3 * * 2,5" | |
concurrency: | |
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}" | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
unittests: | |
if: "github.repository == 'MDAnalysis/mda-xdrlib'" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: install deps | |
run: | | |
python -m pip install wheel coverage | |
- name: install package | |
run: | | |
python -m pip install -e . | |
- name: run tests | |
run: | | |
coverage run -m unittest discover | |
coverage xml | |
- name: test imports | |
working-directory: ../ | |
run: | | |
python -Ic "from mda_xdrlib import xdrlib" | |
- uses: codecov/codecov-action@v3 | |
if: github.event_name != 'schedule' | |
with: | |
files: coverage.xml | |
fail_ci_if_error: true | |
verbose: true |