-
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.
Merge branch 'main' into feature/handling-txt
- Loading branch information
Showing
3 changed files
with
69 additions
and
3 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
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,54 @@ | ||
name: Run test and Tag version | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Run tests🏃 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pytest | ||
- name: Run tests | ||
run: | | ||
python -m pytest | ||
tag: | ||
name: Tag version🔖 | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: ${{ success() }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Get version | ||
id: get_version | ||
run: | | ||
VERSION=$(grep -oP '(?<=__version__ = ")[^"]*' ezpkl/__init__.py) | ||
echo "::set-output name=VERSION::$VERSION" | ||
echo "Current version: $VERSION" | ||
- name: Create tag | ||
run: | | ||
git config --global user.name 'yesinkim' | ||
git config --global user.email '[email protected]' | ||
git tag -a v${{ steps.get_version.outputs.VERSION }} -m "Release version ${{ steps.get_version.outputs.VERSION }}" | ||
git push origin v${{ steps.get_version.outputs.VERSION }} |
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,13 @@ | ||
import pytest | ||
|
||
from ezpkl import save_pkl, load_pkl | ||
|
||
def test_save_pkl(): | ||
data = [1, 2, 3, (4), 5] | ||
save_pkl(data) | ||
assert load_pkl("data.pkl") == data | ||
|
||
def test_save_pkl_with_filename(): | ||
data = [1, 2, 3, 4, 5] | ||
save_pkl(data, file_name="test_data") | ||
assert load_pkl("test_data.pkl") == data |