Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #68 from rmartin16/use-shared-ci
Browse files Browse the repository at this point in the history
Use Shared CI Workflows
  • Loading branch information
freakboy3742 authored Feb 9, 2023
2 parents bfac178 + fbc08d8 commit e21c1bd
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 153 deletions.
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates on Sunday, 8PM UTC
interval: "weekly"
day: "sunday"
time: "20:00"

- package-ecosystem: "pip"
directory: "/"
schedule:
# Check for updates on Sunday, 8PM UTC
interval: "weekly"
day: "sunday"
time: "20:00"
69 changes: 0 additions & 69 deletions .github/labels.toml

This file was deleted.

83 changes: 27 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,84 +5,55 @@ on:
branches:
- main

env:
min_python_version: "3.9"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-python@v4.3.0
with:
python-version: ${{ env.min_python_version }}
- uses: pre-commit/action@v3.0.0
name: Pre-commit checks
uses: beeware/.github/.github/workflows/pre-commit-run.yml@main
with:
pre-commit-source: "pre-commit"

towncrier:
runs-on: ubuntu-latest
steps:
# Fetch main branch for comparison, then check out current branch.
- uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
ref: main
- uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Set up Python 3.X
uses: actions/setup-python@v4.3.0
with:
python-version: "3.X"
- name: Install dependencies
run: |
pip install tox
- name: Run Towncrier
run: |
tox -e towncrier-check
name: Check towncrier
uses: beeware/.github/.github/workflows/towncrier-run.yml@main
with:
tox-source: "tox"

package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Set up Python 3.X
uses: actions/setup-python@v4.3.0
with:
python-version: "3.X"
- name: Install dependencies
run: |
pip install tox
- name: Run pre-test check
run: |
tox -e package
name: Python Package
uses: beeware/.github/.github/workflows/python-package-create.yml@main
with:
tox-source: "tox"

python-versions:
name: Python compatibility test
needs:
- pre-commit
- towncrier
- package
needs: [ pre-commit, towncrier, package ]
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev" ]
include:
- experimental: false

- python-version: "3.12-dev"
experimental: true
steps:
- uses: actions/checkout@v3.1.0
- name: Checkout
uses: actions/checkout@v3.1.0

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

- name: Install system dependencies
run: |
sudo apt-get install -y python3-dev python3-gi gir1.2-gtk-3.0 libgirepository1.0-dev pkg-config
pip install tox
- name: Test
- name: Install Tox
run: |
tox -e py
# We don't actually want to install gbulb; we just want the dev extras
# so that we have a known version of coverage
python -m pip install -e .[dev]
- name: Test
run: tox -e py
12 changes: 12 additions & 0 deletions .github/workflows/dependabot-changenote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Dependabot Change Note

on:
push:
branches:
- 'dependabot/**'

jobs:
changenote:
name: Dependabot Change Note
uses: beeware/.github/.github/workflows/dependabot-changenote.yml@main
secrets: inherit
10 changes: 7 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3.3.0

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4.5.0
with:
python-version: '3.x'
python-version: "3.x"

- name: Install dependencies
run: |
sudo apt-get install -y python3-dev python3-gi gir1.2-gtk-3.0 libgirepository1.0-dev pkg-config
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install tox
- name: Build release artefacts
run: |
tox -e package
- name: Publish release
env:
TWINE_USERNAME: __token__
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
1 change: 1 addition & 0 deletions changes/68.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated CI to use shared workflows from ``.github`` repository.
12 changes: 12 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ package_dir =
install_requires =
pygobject>=3.14.0

[options.extras_require]
# Extras used by developers *of* gbulb are pinned to specific versions to
# ensure environment consistency.
dev =
coverage[toml] == 7.1.0
# Pre-commit 3.0 dropped support for Python 3.7
pre-commit == 2.21.0; python_version < "3.8"
pre-commit == 3.0.2; python_version >= "3.8"
pytest == 7.2.1
pytest-tldr == 0.2.5
tox == 4.4.2

[options.packages.find]
where = src

Expand Down
4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

27 changes: 6 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,15 @@
# and then run "tox" from this directory.

[tox]
envlist = flake8,towncrier-check,docs,package,py{37,38,39,310,311,312},pypy3
envlist = towncrier-check,package,py{37,38,39,310,311,312},pypy3
skip_missing_interpreters = true

[testenv]
setenv = PYTHONPATH = {toxinidir}/src
deps =
pytest
pytest-tldr
pytest-cov
extras =
dev
commands =
pytest --cov -vv
coverage xml

[testenv:flake8]
skip_install = True
deps =
flake8
commands = flake8 {posargs}
python -m coverage run -m pytest -vv

[testenv:towncrier-check]
skip_install = True
Expand All @@ -37,21 +28,15 @@ deps =
commands =
towncrier build {posargs}

[testenv:docs]
deps =
-r{toxinidir}/docs/requirements_docs.txt
commands =
python setup.py build_sphinx -W

[testenv:package]
skip_install = True
deps =
check_manifest
wheel
build
twine
commands =
check-manifest -v
python setup.py sdist bdist_wheel
python -m build --sdist --wheel --outdir dist
python -m twine check dist/*

[testenv:publish]
Expand Down

0 comments on commit e21c1bd

Please sign in to comment.