Skip to content

Commit

Permalink
moving CI to GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
agroszer committed Feb 23, 2023
1 parent 92d0826 commit da78250
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
@@ -1,4 +1,4 @@
[run]
include = */shoobx/immutable/*
omit = */test*

relative_files = True
66 changes: 66 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,66 @@
name: shoobx.immutable

on:
push:
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

services:
postgres:
image:
bitnami/postgresql:latest
env:
# not messing with the default postgres user and database
# POSTGRESQL_USERNAME: postgres
POSTGRESQL_PASSWORD: postgres_password
# POSTGRESQL_DATABASE: postgres
POSTGRESQL_EXTRA_FLAGS: -c max_prepared_transactions=10
ports:
- 5432:5432

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:

- name: Check out source
uses: actions/checkout@v3

- name: Install PostgreSQL client
run: |
sudo apt-get update
sudo apt-get install --yes postgresql-client
- name: Postgres preparations
run: |
# host is localhost because we connected postgres via 5432:5432 at services.postgres.ports
# wait for postgresql here
timeout 90s bash -c "until pg_isready -h localhost -U postgres ; do sleep 2 ; done"
# create the test database
psql -h localhost -d postgres -U postgres -c "create user pjpersist with createdb password 'pjpersist';"
env:
# postgres password is required
PGPASSWORD: postgres_password

- 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 tox tox-gh-actions
- name: Test with tox
run: tox
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
if: matrix.python-version == 3.11
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion CHANGES.rst
Expand Up @@ -6,7 +6,9 @@ CHANGES
2.0.4 (unreleased)
------------------

- Nothing changed yet.
- Moving CI to github actions

- Added python 3.8, 3.9, 3.10, 3.11


2.0.3 (2021-05-06)
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -2,8 +2,8 @@
``shoobx.immutable`` -- Immutable Types
=======================================

.. image:: https://travis-ci.org/Shoobx/shoobx.immutable.png?branch=master
:target: https://travis-ci.org/Shoobx/shoobx.immutable
.. image:: https://github.com/Shoobx/shoobx.immutable/actions/workflows/test.yml/badge.svg
:target: https://github.com/Shoobx/shoobx.immutable/actions

.. image:: https://coveralls.io/repos/github/Shoobx/shoobx.immutable/badge.svg?branch=master
:target: https://coveralls.io/github/Shoobx/shoobx.immutable?branch=master
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Expand Up @@ -64,6 +64,10 @@ def alltests():
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython',
'Natural Language :: English',
'Operating System :: OS Independent'],
Expand Down
27 changes: 11 additions & 16 deletions tox.ini
@@ -1,23 +1,18 @@
[tox]
envlist = py37
envlist = py37, py38, py39, py310, py311

[testenv]
commands =
zope-testrunner -vpc1 --all --test-path ./src
pip_pre = True
deps =
.[test]
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[testenv:py37]
# Python 3.7 is the designated coverage report run.
basepython = python3.7
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
[testenv]
commands =
coverage erase
coverage run {envbindir}/zope-testrunner -vpc1 --all --test-path ./src
coverage run {envbindir}/zope-testrunner -vvc1 --all --test-path ./src
coverage xml
coverage report -m
pip_pre = True
deps =
{[testenv]deps}
coverage
.[test]

0 comments on commit da78250

Please sign in to comment.