Skip to content

Commit

Permalink
Improve CI jobs (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
kytta authored Sep 7, 2024
2 parents 1453c6d + b126ee6 commit b7ba44d
Show file tree
Hide file tree
Showing 13 changed files with 343 additions and 130 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: CI

on:
push:
branches: [main]
tags: ["*"]
pull_request:
branches: [main]
workflow_dispatch:

env:
FORCE_COLOR: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
PIP_NO_PYTHON_VERSION_WARNING: 1

permissions: {}

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v2
id: baipp

outputs:
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}

test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: build

strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(needs.build.outputs.python-versions) }}

steps:
- uses: actions/checkout@v4
- name: Download built package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- uses: actions/setup-python@v5
with:
python-version: |
${{ matrix.python-version }}
3.x
allow-prereleases: true

- uses: astral-sh/setup-uv@v2
- run: uv pip install --system tox-uv

- name: Test
run: python -Im tox run --installpkg dist/*.whl -f py$(echo ${{ matrix.python-version }} | tr -d .)

- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.python-version }}
path: .coverage.*
include-hidden-files: true
if-no-files-found: ignore

coverage:
name: Coverage
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x

- uses: astral-sh/setup-uv@v1
- run: uv pip install --system --upgrade coverage[toml] covdefaults
- uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true

- name: Combine coverage & report
run: |
python -Im coverage combine
python -Im coverage report || true
python -Im coverage html --skip-covered --skip-empty || true
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: htmlcov
if: ${{ failure() }}
66 changes: 0 additions & 66 deletions .github/workflows/main.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build & upload package

on:
release:
types:
- published

permissions:
attestations: write
contents: read
id-token: write

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v2
with:
attest-build-provenance-github: 'true'

# Upload to real PyPI on GitHub Releases.
release:
name: Publish to PyPI
environment: PyPI
runs-on: ubuntu-latest
needs: build

steps:
- name: Download built package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist

- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
32 changes: 0 additions & 32 deletions .github/workflows/release.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ repos:
rev: "2.2.1"
hooks:
- id: pyproject-fmt
args: [--max-supported-python=3.13]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.3.2"
hooks:
- id: tox-ini-fmt
- repo: https://github.com/google/yamlfmt
rev: "v0.13.0"
hooks:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Skyr / Change Log

## Unreleased

### Added

- [#57](https://github.com/kytta/skyr/pull/57):
Support for Python 3.13

### Behind-the-scenes

- [#57](https://github.com/kytta/skyr/pull/57):
Improved CI jobs

- [#57](https://github.com/kytta/skyr/pull/57):
Use flit to build packages

## 0.3.1 - 2023-10-03

### Added
Expand Down
Binary file added assets/logo.afdesign
Binary file not shown.
Loading

0 comments on commit b7ba44d

Please sign in to comment.