Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
Add automatic testing
  • Loading branch information
RichRick1 authored Mar 22, 2024
1 parent 76b5296 commit 3ef600d
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: pytest

on:
push:
branches:
- main
tags-ignore:
- '**'
pull_request:
branches:
- main

jobs:
tests:
name: "Python ${{ matrix.py }} on OS ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
py: ["3.7", "3.9", "3.10", "3.11"]

steps:
- uses: "actions/checkout@v3"

- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}

- name: Install dependencies for testing
run: |
pip install --upgrade pip
pip install pytest pytest-md pytest-emoji pytest-cov
- name: Install development version
run: |
# Need editable mode in order to include the test files
pip install -e .
- name: Run pytest
uses: pavelzw/pytest-action@v2
with:
verbose: true
emoji: true
job-summary: true
click-to-expand: true
custom-arguments: "--junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=gbasis"
report-title: 'Test Report'

- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml

0 comments on commit 3ef600d

Please sign in to comment.