Skip to content

Commit

Permalink
ci: add github CI for tests and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Exirel committed Nov 11, 2023
1 parent 995f708 commit c9129a0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 11 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: CI

on:
push:
branches:
- master
- v[0-9]+.[0-9]+.x
pull_request:
branches:
- master
- v[0-9]+.[0-9]+.x

jobs:
tests:
if: ${{ github.repository_owner == 'sopel-irc' }}
name: Quality & Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade wheel
python -m pip install --upgrade -r requirements.txt
python -m pip install -e .
- name: Lint
run: make lint
- name: Tests
run: make test
30 changes: 19 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
.PHONY: qa quality test coverages coverage_report coverage_html pylint
# Linters (check, style, and type in the future)
.PHONY: lint-check lint-style

quality:
lint-check:
isort sopel_help
flake8

lint-style:
pylint sopel_help
pyroma .

lint: lint-check lint-style

# Tests (tests and coverage reports)
.PHONY: test coverage_report coverage_html coverages

test:
coverage run -m pytest -v .

Expand All @@ -15,20 +25,18 @@ coverage_html:

coverages: coverage_report coverage_html

pylint:
pylint sopel_help

pyroma:
pyroma .

qa: quality test coverages pylint pyroma

.PHONY: develop build
# Development cycle (local install, qa, build, and release on PyPI)
.PHONY: develop qa build

develop:
pip install -U -r requirements.txt
pip install -e .

qa: lint-check test coverages lint-style

build:
rm -rf build/ dist/
python -m build .

release:
twine upload -r sopel-help dist/*

0 comments on commit c9129a0

Please sign in to comment.