Skip to content

Commit

Permalink
Updated ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
loRes228 committed May 21, 2024
1 parent b4a6373 commit cbb796d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,27 @@ on:
- main
tags:
- 'v0.*'
workflow_dispatch:

jobs:
pypi-publish:
name: PyPI Publish
runs-on: ubuntu-latest

permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
cache: pip
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: python -m pip install --upgrade pip build
run: python -m pip install --upgrade build pip

- name: Build package
run: python -m build
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
jobs:
tests:
name: Tests

strategy:
fail-fast: false
matrix:
Expand All @@ -27,12 +28,16 @@ jobs:
- '3.10'
- '3.11'
- '3.12'

defaults:
run:
shell: bash

runs-on: ${{ matrix.os }}

env:
VENV_BIN: ${{ startsWith(matrix.os, 'windows') && 'Scripts' || 'bin' }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -41,18 +46,17 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache: pip
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: pip install --editable .[dev,redis,mongo,sqlalchemy]
run: python -m pip install --upgrade .[dev,redis,mongo,sqlalchemy] build pip

- name: Lint code
run: make lint

- name: Check installable
run: |
pip install build
python -m build --wheel
python -m venv ./venv
./venv/${{ env.VENV_BIN }}/pip install ./dist/*.whl
Expand Down

0 comments on commit cbb796d

Please sign in to comment.