-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
4 changed files
with
72 additions
and
19 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 |
---|---|---|
|
@@ -6,6 +6,28 @@ on: | |
- master | ||
|
||
jobs: | ||
lint: | ||
name: Lint Code | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.13.0rc2 | ||
|
||
- name: Install Dependencies | ||
run: pip install -r requirements-dev.txt | ||
|
||
- name: Install Linter | ||
run: pre-commit install | ||
|
||
- name: Lint Code | ||
run: pre-commit run --all-files | ||
|
||
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
|
@@ -17,22 +39,18 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
python-version: 3.13.0rc2 | ||
|
||
- name: Install Dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Install Test Dependencies | ||
run: pip install -r requirements-dev.txt | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r requirements-dev.txt | ||
- name: Run Tests | ||
run: | ||
| | ||
python -m unittest ntp_amplification_test.py | ||
continue-on-error: true | ||
run: python -m unittest ntp_amplification_test.py | ||
|
||
lint: | ||
name: Lint Code | ||
publish: | ||
name: Check Version and Publish | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -42,13 +60,45 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
python-version: 3.13.0rc2 | ||
|
||
- name: Install Dependencies | ||
run: pip install -r requirements-dev.txt | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r requirements-dev.txt | ||
- name: Install Linter | ||
run: pre-commit install | ||
- name: Get Current Version | ||
id: current_version | ||
run: | | ||
version=$(python -c "exec(open('version.py').read()); print(__version__)") | ||
echo "Current version: $version" | ||
echo "::set-output name=VERSION::$version" | ||
- name: Lint Code | ||
run: pre-commit run --all-files | ||
- name: Check if Version is Incremented | ||
id: version_check | ||
run: | | ||
git fetch origin master | ||
git checkout master | ||
cur_version=$(python -c "exec(open('ntp_amplification/version.py').read()); print(__version__)") | ||
echo "Main branch version: $cur_version" | ||
if [ "$cur_version" = "$version" ]; then | ||
echo "Version has not been incremented, exiting..." | ||
exit 1 | ||
else | ||
echo "Version is incremented, proceeding..." | ||
fi | ||
- name: Push Changes to Repository | ||
if: success() | ||
env: | ||
TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
git config --global user.name "github-actions" | ||
git config --global user.email "[email protected]" | ||
git checkout -b release | ||
git add . | ||
git commit -m "Release version ${{ steps.current_version.outputs.VERSION }}" | ||
git push origin master |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "1.7.1" |