Skip to content

Commit

Permalink
feat: run tests on Github Actions using poetry env (#5, #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlFontal committed Jun 8, 2023
1 parent 0cd9df6 commit d00a9b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
on: [ push ]
# release:
# types: [ published ]
on:
release:
types: [ published ]

name: Build and publish to PyPI
name: Build and publish to PyPi
jobs:
publish-service-client-package:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
with:
ref: feat-test/abstract

- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.17
with:
pypi_token: ${{ secrets.TEST_PYPI_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
repository_name: "sdcpy"
repository_url: "https://test.pypi.org/legacy/"
repository_url: "https://upload.pypi.org/legacy/"
29 changes: 12 additions & 17 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,24 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Checkout repository
uses: actions/checkout@master
with:
ref: ${{ github.ref }}

- name: Install poetry
run: pipx install poetry
- name: Set up Python and cache poetry dependencies
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}

cache: poetry
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev
run: poetry install

- name: Run tests
run: |
pipenv run pytest
poetry run pytest

0 comments on commit d00a9b2

Please sign in to comment.