Skip to content

Commit

Permalink
refactor ci
Browse files Browse the repository at this point in the history
  • Loading branch information
caelean committed Feb 7, 2024
1 parent e4147a8 commit 49c1862
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package
name: ci

on:
push:
Expand All @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand All @@ -27,16 +27,19 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff pytest pytest-mock
python -m pip install ruff pytest pytest-mock coverage
- name: Lint with ruff
run: |
# Ignore unused imports as they are needed to test modguard
ruff check --ignore F401
- name: Test with pytest
run: |
cd tests
pytest
coverage run --branch -m pytest
cd ..
- name: Report coverage
run: |
coverage report
- name: Check modguard
run: |
pip install .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

name: Upload Python Package
name: Publish modguard

on:
release:
Expand All @@ -11,29 +11,7 @@ permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

deploy:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down

0 comments on commit 49c1862

Please sign in to comment.