Skip to content

Commit

Permalink
Switch most of CI to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
encukou committed Jan 8, 2021
2 parents 6928330 + a4cc55e commit 9a84efe
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 24 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,44 @@
on:
push:
branches:
- master
pull_request:

name: Run Tox tests

jobs:
tox_test:
name: Tox test
steps:
- uses: actions/checkout@v2
- name: Run Tox tests
id: test
uses: fedora-python/tox-github-action@master
with:
tox_env: ${{ matrix.tox_env }}
strategy:
matrix:
tox_env: [
py27-c90, py35-c90, py36-c90,
py27-c99, py35-c99, py36-c99, py37-c99, py38-c99, py39-c99, py310-c99,
py27-cpp, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp,
]

# Use GitHub's Linux Docker host
runs-on: ubuntu-latest

py33-test:
name: Python 3.3 test
container: python:3.3
steps:
- uses: actions/checkout@v2
- name: Run tests
env:
CFLAGS: "-Werror -Wall -Wno-error=strict-aliasing"
run: |
CFLAGS="$CFLAGS -std=c90" make test-python
CFLAGS="$CFLAGS -std=c99" make test-python
make test-python-cpp
# Use GitHub's Linux Docker host
runs-on: ubuntu-latest
18 changes: 0 additions & 18 deletions .travis.yml
Expand Up @@ -3,31 +3,13 @@ arch:
- amd64
- ppc64le
python:
- "2.7"
- "3.4"
- "3.5"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "nightly"

env:
- TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing"
- TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c99 -Wno-error=strict-aliasing"
- TEST_USE_CPP=yes CFLAGS="-Werror -Wall -Wno-error=strict-aliasing"

matrix:
exclude:
# CPython 3.8+ won't compile with c90.
- python: "3.8"
env: TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing"
- python: "3.9"
env: TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing"
- python: "nightly"
env: TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing"

script: make test-python

sudo: false
12 changes: 8 additions & 4 deletions Makefile
Expand Up @@ -11,6 +11,9 @@ includedir ?= $(prefix)/include
datarootdir ?= $(prefix)/share
datadir ?= $(datarootdir)
pkgconfigdir ?= ${datadir}/pkgconfig
testbuilddir ?= test/build

_testbuilddir_abs=$(abspath ${testbuilddir})

doc:
cd doc && $(MAKE) html
Expand All @@ -24,16 +27,17 @@ test:
# TODO: A better way to build & use one-off extensions?

build-%:
cd test; rm -rvf build ; $* setup.py build
cd test; rm -rvf ${_testbuilddir_abs} ; $* setup.py build -b ${_testbuilddir_abs}

build-%-cpp:
cd test; rm -rvf build ; TEST_USE_CPP=yes $* setup.py build
cd test; rm -rvf ${_testbuilddir_abs} ; TEST_USE_CPP=yes $* setup.py build -b ${_testbuilddir_abs}

test-%: build-%
PYTHONPATH=$(wildcard test/build/lib*) $* test -v
echo ${_testbuilddir_abs}
PYTHONPATH=$(wildcard ${_testbuilddir_abs}/lib*) $* test -v

test-%-cpp: build-%-cpp
TEST_USE_CPP=yes PYTHONPATH=$(wildcard test/build/lib*) $* test -v
TEST_USE_CPP=yes PYTHONPATH=$(wildcard ${_testbuilddir_abs}/lib*) $* test -v

$(includedir):
mkdir -p $(includedir)
Expand Down
1 change: 1 addition & 0 deletions doc/source/changelog.rst
Expand Up @@ -7,6 +7,7 @@ py3c Changes
Version History
===============


v1.3.1 (2021-01-07)
-----------------

Expand Down
12 changes: 10 additions & 2 deletions tox.ini
@@ -1,6 +1,14 @@
[tox]
envlist = py27,py34,py35,py36,py37,py38,py39
envlist = py{27,34,35,36}-{c90,c99,cpp},py{37,38,39,310}-{c99,cpp}
skipsdist = True

[testenv]
commands = make test-python
allowlist_externals = make
commands = make testbuilddir={envdir}/build test-python
setenv=
c90: TEST_USE_CPP=no
c90: CFLAGS=-Werror -Wall -std=c90 -Wno-error=strict-aliasing
c99: TEST_USE_CPP=no
c99: CFLAGS=-Werror -Wall -std=c99 -Wno-error=strict-aliasing
cpp: TEST_USE_CPP=yes
cpp: CFLAGS=-Werror -Wall -Wno-error=strict-aliasing

0 comments on commit 9a84efe

Please sign in to comment.