Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI with a lint job, updated action versions, and minor renames #6

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 34 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# A very basic Github Workflow.

# This workflow will install Python dependencies, run tests and lint with a
# single version of Python.
# This workflow will install Python dependencies, run tests across multiple
# Python versions, and lints things with a single version of Python.
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
---
name: CI

name: Test

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- "*"
Expand All @@ -16,45 +14,66 @@ on:
- "*"

jobs:
build:
tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: False
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
allowed-to-fail: [False]
allowed-to-fail: [false]
include:
- python-version: "3.12"
allowed-to-fail: True
allowed-to-fail: true
name: "Build and Test: Python ${{ matrix.python-version }}"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"

- name: Install dependencies
continue-on-error: ${{ matrix.allowed-to-fail }}
run: |
pip install --upgrade pip setuptools wheel
pip install -e .[dev]

- name: Run tests
continue-on-error: ${{ matrix.allowed-to-fail }}
run: |
pytest

lint:
# TODO: DRY this with tests job
name: "Lint"
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: "Set up Python 3.8"
uses: actions/setup-python@v4
with:
python-version: "3.8"

- name: Install dependencies
run: |
pip install -e .[dev]

- name: Run lint
run: |
pre-commit run --all-files

# A summary of all jobs and their result.
# This is the only job that's required to pass (as set by branch protection
# rules in repo settings) so that we don't have to update those rules when
# a new job is added.
check-all-jobs:
if: always()
needs:
- build
- tests
- lint
runs-on: ubuntu-latest
steps:
- name: Check status of all jobs.
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
name: Publish to PyPI

on:
on: # yamllint disable-line rule:truthy
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build-and-deploy:
name: "Build and deploy to PyPI"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"

- name: "Set up Python 3.8"
uses: "actions/setup-python@v2"
uses: "actions/setup-python@v4"
with:
python-version: "3.8"

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
+ CI now runs tests against multiple Python versions. (#2)
+ Updated dependencies to work with py3.10 and py3.11. (#3)
+ Switched to `ruff` for linting. (#5)
+ Updated CI to also run all pre-commit checks and use more recent actions. (#6)


## v1.0.0 (2023-01-14)
Expand Down
Loading