Skip to content

Commit

Permalink
Update pyproject metadata and expand github CI tests
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT committed Aug 11, 2023
1 parent 673522f commit 8ccf9b6
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
codecov:
notify:
after_n_builds: 4
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
workflow_dispatch:
inputs:
upload-wheel:
type: boolean
required: false
default: false
description: Upload wheel as an artifact
pull_request:
push:
branches: [ main ]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
uses: ./.github/workflows/step_test.yaml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

build-wheel:
uses: ./.github/workflows/step_build-wheel.yaml
needs: [ tests ]
with:
upload: ${{ inputs.upload-wheel || false }}
14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/step_build-wheel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
workflow_call:
inputs:
upload:
required: false
type: boolean
default: true
description: Upload wheel as artifact

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build package
run: pipx run build
- uses: actions/upload-artifact@v3
with:
path: dist/*
if: ${{ inputs.upload }}
42 changes: 42 additions & 0 deletions .github/workflows/step_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: false
description: Codecov token

permissions:
contents: read

jobs:
pre-commit:
name: Run pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]

checks:
name:
Check 🐍 ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install package
run: pip install -e.[tests-cov]
- name: Test package
run: pytest --cov --cov-report=xml
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
name: python-${{ matrix.python-version }}
12 changes: 8 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ license = 'GPL-2.0-or-later'
license-files = { paths = ['LICENSE'] }
requires-python = '>=3.9'
classifiers = [
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Natural Language :: English',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Utilities',
]
keywords = [
Expand All @@ -41,6 +41,10 @@ Homepage = 'https://github.com/psss/fmf'
tests = [
'pytest',
]
tests-cov = [
'fmf[tests]',
'pytest-cov',
]
dev = [
'fmf[tests]',
'pre-commit',
Expand Down

0 comments on commit 8ccf9b6

Please sign in to comment.