Skip to content

Commit

Permalink
chore: improve github action test script
Browse files Browse the repository at this point in the history
  • Loading branch information
luochen1990 committed Jul 26, 2024
1 parent b45a401 commit 63d62e7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,30 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
install-ai-powered-cmd:
- pip install ai_powered
- poetry build && pip install ai_powered

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install dev/test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-xdist ai_powered
python -m pip install --upgrade pip poetry
python -m pip install flake8 pytest pytest-xdist
- name: Install The Tested Package
run: |
if [[ "${{ github.event.head_commit.message }}" == "version:"* ]]; then
echo "This is a version bump commit. Installing the package from pypi."
pip install ai_powered@latest
else
echo "This is not a version bump commit. Installing the package from built wheel."
THIS_PACKAGE_WHL=$(poetry build -f wheel | grep whl | rev | cut -d' ' -f1 | rev)
pip install $THIS_PACKAGE_WHL
fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down

0 comments on commit 63d62e7

Please sign in to comment.