-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add automatic publishing using version tags, lint, and update workflows #253
Open
PCain02
wants to merge
24
commits into
GatorEducator:master
Choose a base branch
from
PCain02:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
57b0786
feat: add test_publish.yml file for automatic test publishing with th…
PCain02 c0ee5aa
feat: add tag_publish.yml file for automatic test publishing with the…
PCain02 4e8e579
fix: typo in tag publish.yml
PCain02 e9addeb
test: test-publish
PCain02 311ac19
fix: add pyyaml to toml to test test-publish
PCain02 098bc1e
update dependancies and test-publish
PCain02 64bdae5
update poetry version hoping to fix linting errors
PCain02 b81312f
update main.yml poetry version and python version
PCain02 08f1ed3
update toml version for test publish
PCain02 3693ed8
feat: update coverage process in main.yml
PCain02 a72cabb
feat: update coverage process to check for xml file
PCain02 3c64620
feat: update coverage process to check for xml file
PCain02 7ead445
feat: update toml for coverage
PCain02 069574c
fix: change coverage workflow
PCain02 dca7ac7
fix: coverage report
PCain02 7bd4b67
test: delete upload coverage
PCain02 c52fdc4
fix add utf-8 to test_orchestrate
PCain02 89adf89
fix add utf-8 to test_orchestrate
PCain02 a950eef
fix add utf-8 to test_orchestrate
PCain02 30ab816
lint: lint code
PCain02 ffd2fd3
lint: fix newline
PCain02 fa6fabe
lint files
PCain02 38c2c81
lint: report and checkers
PCain02 9cb1bd9
lint: black formating test_orchestrate and report
PCain02 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.13 | ||
poetry-version: 1.5.1 | ||
- name: Setup Poetry | ||
run: | | ||
poetry config virtualenvs.create true | ||
|
@@ -38,8 +38,8 @@ jobs: | |
test: | ||
# Test uses a strategy matrix to ensure that sufficient platform test | ||
# coverage is reached. For this configuration, we run the latest Ubuntu | ||
# image with Python 3.6 and 3.9, while also including MacOS + Python 3.8 and | ||
# Windows + Python 3.7. With this spread, we achieve testing of four | ||
# image with Python 3.8 and 3.10, while also including MacOS + Python 3.9 and | ||
# Windows + Python 3.8. With this spread, we achieve testing of four | ||
# different Python versions and three operating systems without running the | ||
# full twelve possible combinations, greatly reducing load and usage. | ||
name: Test | ||
|
@@ -51,7 +51,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.7", "3.10"] | ||
python-version: ["3.8", "3.10"] | ||
include: | ||
- os: macos-latest | ||
python-version: "3.9" | ||
|
@@ -71,27 +71,15 @@ jobs: | |
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.13 | ||
poetry-version: 1.5.1 | ||
- name: Setup Poetry | ||
run: | | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
poetry env info | ||
- name: Install dependencies | ||
run: poetry install --no-interaction --no-ansi | ||
- name: Execute tests | ||
# We need to ensure that the cover-win script is run for Windows, so | ||
# this Action runs different commands based on the runner's operating | ||
# system. | ||
uses: knicknic/os-specific-run@v1 | ||
with: | ||
linux: poetry run task cover | ||
macos: poetry run task cover | ||
windows: poetry run task cover-win | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
files: ./coverage.xml | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
fail_ci_if_error: true | ||
- name: Run Tests and Generate Coverage | ||
run: | | ||
poetry run pytest -s --cov=gator --cov-report xml:coverage.xml | ||
ls -l coverage.xml |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Publishing workflow | ||
|
||
name: Publish | ||
|
||
# Use more columns for terminal output | ||
env: | ||
COLUMNS: 120 | ||
PYTHONIOENCODING: utf8 | ||
|
||
# trigger the publishing of the | ||
# gatorgrader package to PyPI | ||
# with any tag starting with 'v' | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
# Create one single job | ||
# that publishes the package | ||
# to PyPI using Poetry | ||
|
||
jobs: | ||
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.12' | ||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Install dependencies | ||
run: | | ||
poetry install | ||
- name: Configure Poetry for PyPI | ||
run: | | ||
poetry config repositories.pypi https://upload.pypi.org/legacy/ | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | ||
- name: Publish package to PyPI | ||
run: | | ||
poetry publish --repository pypi --build | ||
- name: Check for Successful Publication | ||
run: | | ||
version=$(poetry version --short) | ||
echo "Checking if package gatorgrader version $version is available on PyPI..." | ||
response=$(curl -s "https://pypi.org/pypi/gatorgrader/$version/json") | ||
if echo "$response" | grep -q "$version"; then | ||
echo "Package gatorgrader version $version is successfully published on PyPI." | ||
else | ||
echo "Package gatorgrader version $version was not found on PyPI." | ||
exit 1 | ||
fi | ||
|
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Test Publishing workflow | ||
name: Test Publish | ||
|
||
# Use more columns for terminal output | ||
env: | ||
COLUMNS: 120 | ||
PYTHONIOENCODING: utf8 | ||
|
||
# trigger the test publishing of the | ||
# gatorgrader package to PyPI | ||
# with any tag starting with 't' | ||
on: | ||
push: | ||
tags: | ||
- 't*' | ||
|
||
# Create one single job | ||
# that test publishes the package | ||
# to PyPI using Poetry | ||
jobs: | ||
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.11' # Use the Python version compatible with your project | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Install dependencies | ||
run: | | ||
poetry install | ||
|
||
- name: Configure Poetry for TestPyPI | ||
run: | | ||
poetry config repositories.testpypi https://test.pypi.org/legacy/ | ||
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }} | ||
|
||
- name: Publish package to TestPyPI | ||
run: | | ||
poetry publish --repository testpypi --build | ||
|
||
- name: Check for Successful Publication | ||
run: | | ||
version=$(poetry version --short) | ||
echo "Checking if package gatorgrader version $version is available on TestPyPI..." | ||
response=$(curl -s "https://test.pypi.org/pypi/gatorgrader/$version/json") | ||
if echo "$response" | grep -q "$version"; then | ||
echo "Package gatorgrader version $version is successfully published on TestPyPI." | ||
else | ||
echo "Package gatorgrader version $version was not found on TestPyPI." | ||
exit 1 | ||
fi |
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to find a way to upload coverage properly.