Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### PR Checklist
- [ ] Perform self-review of code
- [ ] Add unit tests
- [ ] Update documentation
58 changes: 58 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# run 1 time per month (on the 1st day of the month at 6:40 AM) = "40 6 1 * *"
# run 1 time per week on Monday at 6:40 AM = "40 6 * * 1"
schedule:
- cron: "40 6 * * 1"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Mambaforge-pytest:
name: Unit-Test (${{ matrix.os }}, Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
os: ["macos", "windows", "ubuntu"]
include:
- os: macos
- environment-file: environment.yml
- os: windows
environment-file: environment.yml
- os: ubuntu
environment-file: environment.yml

steps:
- name: Checkout Branch / Pull Request
uses: actions/checkout@v4

- name: Install Mamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ${{ matrix.environment-file }}
python-version: ${{ matrix.python-version }}
use-mamba: true

- shell: bash -l {0}
run: |
pip install .

- shell: bash -l {0}
name: Test (OS -> ${{ matrix.os }} / Python -> ${{ matrix.python-version }})
run: python -m pytest -v --color yes python_github_tutorial/tests --cov
#run: python -m pytest -v --cov=python_github_tutorial --cov-report=xml --cov-append --cov-config=setup.cfg --color yes python_github_tutorial/tests
#echo "tests finished"

#- name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![CI](https://github.com/pace-gt/python_github_tutorial/actions/workflows/CI.yml/badge.svg)](https://github.com/pace-gt/python_github_tutorial/blob/main/.github/workflows/CI.yml)

# python_github_tutorial

## Overview
Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ dependencies:
- python
- numpy
- pytest
- pytest-cov
- coverage
- pip
- mock
- ipython
Expand Down
Loading