Skip to content

✅ Feat: add tests, update CI/CD config #5

✅ Feat: add tests, update CI/CD config

✅ Feat: add tests, update CI/CD config #5

Workflow file for this run

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
# 테스트 실패 시 워크플로우 종료
if: ${{ failure() }}
continue-on-error: false
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 }}