Skip to content

Commit

Permalink
Refresh CI setup
Browse files Browse the repository at this point in the history
Migrate from Circle to GitHub Actions.
Drop python 2 configurations from testing.
  • Loading branch information
rohanpm committed Dec 12, 2022
1 parent 750cae0 commit 6d6ff92
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 173 deletions.
69 changes: 0 additions & 69 deletions .circleci/config.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish docs

on:
push:
branches:
- master
workflow_dispatch: {}

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Tox
run: pip install tox
- name: Run Tox
run: tox -e docs
- name: Publish
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/_build/html
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish on PyPI

on:
push:
tags:
- v*

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests

on:
pull_request: {}
push:
branches:
- master

jobs:
tox:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
tox_env: [tests, static, docs, pidiff]
py: [3.11]
exclude:
- tox_env: static # FIXME: not currently working
py: 3.11
include:
- tox_env: tests # oldest py3 version for testing
py: 3.8
- tox_env: static # see above FIXME
py: 3.8
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py }}
- name: Install Tox
run: pip install tox
- name: Run Tox
run: tox -e ${{ matrix.tox_env }}
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

35 changes: 0 additions & 35 deletions scripts/push-docs

This file was deleted.

30 changes: 6 additions & 24 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
[tox]
envlist = py26,py27,py36,py37,py38,static,docs,pidiff
envlist = tests,static,docs,pidiff

[testenv]
passenv = COVERALLS_REPO_TOKEN CIRCLECI CIRCLE_* CI_PULL_REQUEST
deps=
-rrequirements.txt
-rtest-requirements.txt
commands=
pytest --cov-report=html --cov=more_executors -v \
--junit-xml=test-results/more_executors/junit.xml {posargs}
whitelist_externals=sh

[testenv:py26]
# no dependency pinning on python2
deps=
-rtest-requirements.in
basepython=python2.6
# For python 2.6, we'll avoid having coverage enabled
# because it slows down the execution a lot
commands=
pytest -v \
--junit-xml=test-results/more_executors/junit.xml {posargs}

[testenv:py27]
deps=
-rtest-requirements.in
prometheus-client==0.9.0
basepython=python2.7
allowlist_externals=sh

[testenv:static]
commands=
sh -c 'pylint more_executors tests; test $(( $? & (1|2|4|32) )) = 0'

[testenv:docs]
deps=-rdocs-requirements.txt
whitelist_externals=sh
allowlist_externals=sh
use_develop=true
commands=
sh -c '\
Expand All @@ -49,19 +31,19 @@ commands=
pidiff more-executors .

[testenv:revdep-pulplib]
whitelist_externals=sh
allowlist_externals=sh
use_develop=true
commands=
sh -c 'scripts/revdep-test https://github.com/release-engineering/pubtools-pulplib.git'

[testenv:revdep-fastpurge]
whitelist_externals=sh
allowlist_externals=sh
use_develop=true
commands=
sh -c 'scripts/revdep-test https://github.com/release-engineering/python-fastpurge.git'

[testenv:revdep-ubipop]
whitelist_externals=sh
allowlist_externals=sh
use_develop=true
commands=
sh -c 'scripts/revdep-test https://github.com/release-engineering/ubi-population-tool.git'
Expand Down

0 comments on commit 6d6ff92

Please sign in to comment.