-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
408dea1
commit 53cec92
Showing
7 changed files
with
453 additions
and
453 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
name: Publish Tag-Versioned Python Package | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Check for existing dist directory | ||
run: | | ||
if [ -d "dist" ]; then | ||
echo "Error: 'dist' directory already exists." >&2 | ||
exit 1 | ||
fi | ||
- name: Build distribution | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Check distribution | ||
run: | | ||
twine check dist/* | ||
- name: Upload distribution to PyPI | ||
run: | | ||
twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI }} | ||
name: Publish Tag-Versioned Python Package | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Check for existing dist directory | ||
run: | | ||
if [ -d "dist" ]; then | ||
echo "Error: 'dist' directory already exists." >&2 | ||
exit 1 | ||
fi | ||
- name: Build distribution | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Check distribution | ||
run: | | ||
twine check dist/* | ||
- name: Upload distribution to PyPI | ||
run: | | ||
twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
# .github/workflows/python-tests.yml | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' # Trigger on push to all branches | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest # The environment to run the job in | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 # Checkout the repository code | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' # Specify the Python version to use | ||
|
||
- name: Install dependencies | ||
run: | | ||
if [ -f requirements.txt ]; then | ||
echo "requirements.txt found, installing dependencies..." | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
else | ||
echo "requirements.txt not found, skipping dependency installation." | ||
fi | ||
- name: Run tests | ||
run: | | ||
mkdir -p test-results # Create directory for test results | ||
python -m unittest discover -s tests -p "*test.py" | tee test-results/test_output.log | ||
# Here, we're redirecting output to a log file in the test-results directory | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: unittest-results | ||
path: test-results/test_output.log | ||
# .github/workflows/python-tests.yml | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' # Trigger on push to all branches | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest # The environment to run the job in | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 # Checkout the repository code | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' # Specify the Python version to use | ||
|
||
- name: Install dependencies | ||
run: | | ||
if [ -f requirements.txt ]; then | ||
echo "requirements.txt found, installing dependencies..." | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
else | ||
echo "requirements.txt not found, skipping dependency installation." | ||
fi | ||
- name: Run tests | ||
run: | | ||
mkdir -p test-results # Create directory for test results | ||
python -m unittest discover -s tests -p "*test.py" | tee test-results/test_output.log | ||
# Here, we're redirecting output to a log file in the test-results directory | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: unittest-results | ||
path: test-results/test_output.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.vscode/ | ||
__pycache__/ | ||
build | ||
dist | ||
*.egg-info/ | ||
*.ipynb | ||
.vscode/ | ||
__pycache__/ | ||
build | ||
dist | ||
*.egg-info/ | ||
*.ipynb | ||
*temp* |
Oops, something went wrong.