✅ Feat: add tests, update CI/CD config #6
Workflow file for this run
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
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 }} |