Skip to content

Commit f9e1144

Browse files
committed
Added GithubActions build
1 parent 8df9473 commit f9e1144

File tree

4 files changed

+100
-1
lines changed

4 files changed

+100
-1
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "monthly"

.github/workflows/python-package.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: tsx-package-build
5+
6+
on:
7+
push:
8+
branches: [ $default-branch, master ]
9+
paths-ignore:
10+
- '**.md'
11+
- '**.rst'
12+
pull_request:
13+
branches: [ '**' ]
14+
paths-ignore:
15+
- '**.md'
16+
- '**.rst'
17+
18+
jobs:
19+
build:
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false # Changed to false to see all failures
23+
matrix:
24+
os: [ ubuntu-latest, windows-latest, macos-latest, ubuntu-24.04-arm ]
25+
python-version: [ "3.8","3.9","3.10", "3.11","3.12", "3.13" ] # ToDo: add support for 3.14 when it's available in GitHub Actions
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v3
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
python -m pip install flake8 pytest coverage
38+
pip install -e ".[dev]"
39+
- name: Lint with flake8
40+
run: |
41+
# stop the build if there are Python syntax errors or undefined names
42+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
43+
# exit-zero treats all errors as warnings
44+
flake8 . --count --exit-zero --max-complexity=20 --max-line-length=160 --statistics
45+
46+
- name: Run tests with coverage
47+
run: |
48+
coverage run --branch run_tests.py
49+
coverage report
50+
51+
build-container:
52+
runs-on: ubuntu-latest
53+
container:
54+
image: python:3.12-bullseye
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Install dependencies in container
59+
run: |
60+
python -m pip install --upgrade pip
61+
python -m pip install flake8 pytest coverage
62+
pip install -e ".[dev]"
63+
64+
- name: Lint with flake8 in container
65+
run: |
66+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
67+
flake8 . --count --exit-zero --max-complexity=20 --max-line-length=160 --statistics
68+
69+
- name: Run tests in container
70+
run: |
71+
coverage run --branch run_tests.py
72+
coverage report

run_tests.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env python
2+
import sys
3+
import unittest
4+
5+
if __name__ == '__main__':
6+
# Discover and run tests
7+
loader = unittest.TestLoader()
8+
start_dir = 'tests'
9+
suite = loader.discover(start_dir, pattern='test_*.py')
10+
11+
# Run tests with verbosity=2 for detailed output
12+
runner = unittest.TextTestRunner(verbosity=2)
13+
result = runner.run(suite)
14+
15+
# Exit with non-zero code if tests failed
16+
sys.exit(not result.wasSuccessful())

upload.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
python setup.py bdist_wheel
2-
twine upload dist/*.whl -u asuiu --verbose
2+
twine upload dist/*.whl --config-file C:\Users\ASU\.pypirc --verbose

0 commit comments

Comments
 (0)