Skip to content

Commit

Permalink
Update CI and release workflows (#2)
Browse files Browse the repository at this point in the history
* Update CI and releas workflows

* update CI workflow

* Remove linter from CI workflow

* Update make tests command

* Update package install in CI

* Update venv path for cache

* Update poetry settings
  • Loading branch information
imenelydiaker authored Jun 23, 2024
1 parent deb5caf commit 28575d8
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 61 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [master]
pull_request:

defaults:
run:
shell: bash

jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Set up virtualenv
run: |
poetry config virtualenvs.in-project true
- uses: actions/cache@v3
name: Cache
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install --with dev
- name: Run tests
run: |
make tests
60 changes: 0 additions & 60 deletions .github/workflows/github-actions.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
release:

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Set up virtualenv
run: |
poetry config virtualenvs.in-project true
- uses: actions/cache@v3
name: Cache
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
- name: Build
run: poetry build
- name: Publish
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ install:
.PHONY: tests
tests:
@echo "--- 🧪 Running tests ---"
pytest tests/
poetry run pytest

0 comments on commit 28575d8

Please sign in to comment.