Skip to content

Commit a887dfe

Browse files
committed
Add CI with github actions and nox
1 parent c4d1812 commit a887dfe

File tree

5 files changed

+49
-12
lines changed

5 files changed

+49
-12
lines changed

.github/workflows/runtests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: runtests
2+
run-name: Run test suite for trac-github
3+
on: [pull_request]
4+
jobs:
5+
runtests-py2:
6+
runs-on: ubuntu-20.04
7+
container:
8+
image: python:2.7.18-buster
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- run: pip install nox-py2
13+
- run: git config --global user.name runtest
14+
- run: git config --global user.email runtest@localhost
15+
- run: nox --non-interactive --error-on-missing-interpreter --session runtests -- --git-default-branch=master
16+
17+
# runtests-py3:
18+
# runs-on: ubuntu-latest
19+
# steps:
20+
# - uses: wntrblm/[email protected]
21+
# with:
22+
# python-versions: "3.7"
23+
# - uses: actions/checkout@v4
24+
# - run: git config --global user.name runtest
25+
# - run: git config --global user.email runtest@localhost
26+
# - run: git config --global init.defaultBranch main
27+
# - run: nox --non-interactive --error-on-missing-interpreter --session runtests

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

noxfile.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import sys
2+
3+
import nox
4+
5+
if sys.version_info.major == 2:
6+
TRAC_VERSIONS = ["1.4.4", "1.2.6"]
7+
else:
8+
TRAC_VERSIONS = ["1.6"]
9+
10+
11+
@nox.session
12+
@nox.parametrize("trac", TRAC_VERSIONS)
13+
def runtests(session, trac):
14+
session.install("-r", "requirements_test.txt")
15+
session.install("Trac==%s" % trac)
16+
session.run("python", "runtests.py", *session.posargs)

requirements_test.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-e .
2+
requests-oauthlib==1.3.1
3+
lxml==5.0.1
4+
# Obviously Trac is also needed, but because we want to test several versions
5+
# then we install it manually

runtests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,6 +2190,7 @@ def get_parser():
21902190

21912191
TESTDIR = tempfile.mkdtemp(prefix='trac-github-test-')
21922192
print "Starting tests using temporary directory %r" % TESTDIR
2193+
print "Using git version %s" % git_check_output('--version').strip()
21932194

21942195
try:
21952196
test_program = unittest.main(argv=[sys.argv[0]] + unittest_argv, exit=False)

0 commit comments

Comments
 (0)