Skip to content

Commit

Permalink
Adding Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
radioxoma committed Apr 14, 2023
1 parent c9c8c27 commit 50e5718
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 4 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: write

jobs:
release-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with: # Latest Windows 7 compatible binary release from python.org
python-version: "3.8.10"
architecture: x86
- run: python -m unittest -v
- name: Install packaging dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- run: .\build.bat
- uses: softprops/action-gh-release@v1
with:
files: "dist/*"
# draft: true
fail_on_unmatched_files: true
release-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- run: python -m unittest -v
- name: Install packaging dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- run: ./build_osx.sh
- uses: softprops/action-gh-release@v1
with:
files: "dist/*"
# draft: true
fail_on_unmatched_files: true
26 changes: 26 additions & 0 deletions .github/workflows/python-unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Unittests

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

permissions:
contents: read

jobs:
unittest:

runs-on: ubuntu-20.04 # Versions =< 3.8.11 not awailable for ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8.10", "3"] # 3.8.10 for Windows 7

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- run: python -m unittest -v
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dev = [
version = {attr = "heval.__version__"}

[project.urls]
Homepage = "https://github.com/radioxoma/heval"
homepage = "https://github.com/radioxoma/heval"

[project.gui-scripts]
heval = "heval.__main__:main"
8 changes: 5 additions & 3 deletions tests/test_doctest.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/env python

import doctest
import unittest

from heval import abg, drugs, electrolytes, human, nutrition

DOCTESTS = (abg, drugs, electrolytes, human, nutrition)
modules = (abg, drugs, electrolytes, human, nutrition)


def load_tests(loader, tests, ignore):
tests.addTests([doctest.DocTestSuite(t) for t in DOCTESTS])
def load_tests(loader: unittest.TestLoader, tests, pattern) -> unittest.TestSuite:
"""Callback to load doctests from modules."""
tests.addTests([doctest.DocTestSuite(m) for m in modules])
return tests

0 comments on commit 50e5718

Please sign in to comment.