Skip to content

Commit ef34d77

Browse files
author
Hugo Osvaldo Barrera
committed
Use Sourcehut for CI
1 parent 255ea8f commit ef34d77

12 files changed

+145
-229
lines changed

.builds/style.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
image: archlinux
2+
packages:
3+
- docker
4+
- docker-compose
5+
- python-pip
6+
sources:
7+
- https://github.com/pimutils/vdirsyncer
8+
tasks:
9+
- setup: |
10+
cd vdirsyncer
11+
make -e install-style
12+
- test: |
13+
cd vdirsyncer
14+
# Non-system python is used for packages:
15+
export PATH=$PATH:~/.local/bin/
16+
make -e style

.builds/tests-minimal.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# TODO: Maybe shift this job to ubuntu/debian.
2+
image: archlinux
3+
packages:
4+
- docker
5+
- docker-compose
6+
- python-pip
7+
sources:
8+
- https://github.com/pimutils/vdirsyncer
9+
environment:
10+
BUILD: test
11+
CI: true
12+
REQUIREMENTS: minimal
13+
# TODO: ETESYNC_TESTS
14+
tasks:
15+
- setup: |
16+
cd vdirsyncer
17+
sudo systemctl start docker
18+
DAV_SERVER="radicale xandikos" make -e install-test
19+
- test: |
20+
cd vdirsyncer
21+
# Non-system python is used for packages:
22+
export PATH=$PATH:~/.local/bin/
23+
make -e ci-test
24+
DAV_SERVER=radicale make -e ci-test-storage
25+
DAV_SERVER=xandikos make -e ci-test-storage

.builds/tests-release.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
image: archlinux
2+
packages:
3+
- docker
4+
- docker-compose
5+
- python-pip
6+
sources:
7+
- https://github.com/pimutils/vdirsyncer
8+
environment:
9+
BUILD: test
10+
CI: true
11+
REQUIREMENTS: release
12+
# TODO: ETESYNC_TESTS
13+
tasks:
14+
- setup: |
15+
cd vdirsyncer
16+
sudo systemctl start docker
17+
DAV_SERVER="radicale xandikos" make -e install-test
18+
- test: |
19+
cd vdirsyncer
20+
# Non-system python is used for packages:
21+
export PATH=$PATH:~/.local/bin/
22+
make -e ci-test
23+
DAV_SERVER=radicale make -e ci-test-storage
24+
DAV_SERVER=xandikos make -e ci-test-storage

.pre-commit-config.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ repos:
55
- id: trailing-whitespace
66
args: [--markdown-linebreak-ext=md]
77
- id: end-of-file-fixer
8-
exclude: '.travis.yml'
98
- id: check-toml
109
- id: check-added-large-files
1110
- id: debug-statements
@@ -18,12 +17,3 @@ repos:
1817
rev: v2.3.0
1918
hooks:
2019
- id: reorder-python-imports
21-
- repo: local
22-
hooks:
23-
- id: update-travis
24-
name: Update travis job definition
25-
description: Ensures that travis job definition are up to date.
26-
entry: scripts/make_travisconf.py
27-
files: '.*travis.*'
28-
stages: [commit]
29-
language: script

.travis.yml

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

Makefile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export DETERMINISTIC_TESTS := false
1515
# Run the etesync testsuite.
1616
export ETESYNC_TESTS := false
1717

18-
# Assume to run in Travis. Don't use this outside of a virtual machine. It will
18+
# Assume to run in CI. Don't use this outside of a virtual machine. It will
1919
# heavily "pollute" your system, such as attempting to install a new Python
2020
# systemwide.
2121
export CI := false
@@ -41,17 +41,17 @@ export TESTSERVER_BASE := ./tests/storage/servers/
4141
CODECOV_PATH = /tmp/codecov.sh
4242

4343
ifeq ($(CI), true)
44-
test-storage:
45-
curl -s https://codecov.io/bash > $(CODECOV_PATH)
46-
$(PYTEST) tests/storage/
47-
bash $(CODECOV_PATH) -c -F storage
48-
test:
44+
ci-test:
4945
curl -s https://codecov.io/bash > $(CODECOV_PATH)
5046
$(PYTEST) tests/unit/
5147
bash $(CODECOV_PATH) -c -F unit
5248
$(PYTEST) tests/system/
5349
bash $(CODECOV_PATH) -c -F system
5450
[ "$(ETESYNC_TESTS)" = "false" ] || make test-storage
51+
ci-test-storage:
52+
curl -s https://codecov.io/bash > $(CODECOV_PATH)
53+
$(PYTEST) tests/storage/
54+
bash $(CODECOV_PATH) -c -F storage
5555
else
5656
test:
5757
$(PYTEST)
@@ -79,10 +79,6 @@ install-test: install-servers install-dev
7979
fi
8080
[ -z "$(TEST_EXTRA_PACKAGES)" ] || pip install $(TEST_EXTRA_PACKAGES)
8181

82-
install-test-storage: install-test
83-
# This is just an alias
84-
true
85-
8682
install-style: install-docs install-dev
8783
pip install pre-commit
8884

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
vdirsyncer
33
==========
44

5-
.. image:: https://travis-ci.org/pimutils/vdirsyncer.svg?branch=master
6-
:target: https://travis-ci.org/pimutils/vdirsyncer
5+
.. image:: https://builds.sr.ht/~whynothugo/vdirsyncer.svg
6+
:target: https://builds.sr.ht/~whynothugo/vdirsyncer
77
:alt: CI status
88

99
.. image:: https://codecov.io/github/pimutils/vdirsyncer/coverage.svg?branch=master

docs/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Submitting patches, pull requests
7575
Running tests, how to set up your development environment
7676
---------------------------------------------------------
7777

78-
For many patches, it might suffice to just let Travis run the tests. However,
79-
Travis is slow, so you might want to run them locally too. For this, set up a
78+
For many patches, it might suffice to just let CI run the tests. However,
79+
CI is slow, so you might want to run them locally too. For this, set up a
8080
virtualenv_ and run this inside of it::
8181

8282
# install:

scripts/make_ci_conf.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env python
2+
from pathlib import Path
3+
4+
REPO_ROOT = Path(__file__).parent.parent
5+
6+
builds = [
7+
{
8+
"BUILD": "style",
9+
"REQUIREMENTS": "release",
10+
"DAV_SERVER": "skip",
11+
},
12+
{
13+
"ETESYNC_TESTS": "true",
14+
"BUILD": "test",
15+
"REQUIREMENTS": "release",
16+
"DAV_SERVER": "skip",
17+
},
18+
]
19+
20+
# XXX: Use `devel` here for recent python versions:
21+
for requirements in ("release", "minimal"):
22+
# XXX: `fastmail` has been left out here:
23+
dav_servers = ("radicale", "xandikos")
24+
25+
builds.append(
26+
{
27+
"BUILD": "test",
28+
"REQUIREMENTS": requirements,
29+
"DAV_SERVER": "skip",
30+
},
31+
)
32+
33+
for dav_server in dav_servers:
34+
job = {
35+
"BUILD": "test-storage",
36+
"REQUIREMENTS": requirements,
37+
"DAV_SERVER": dav_server,
38+
}
39+
40+
41+
with open(REPO_ROOT / "scripts" / "tests.template") as f:
42+
template = f.read()
43+
44+
# TODO: Delete previous ones...
45+
46+
for i, build in enumerate(builds):
47+
with open(REPO_ROOT / ".builds" / f"{i}.yaml", "w") as f:
48+
f.write(template.format(**build))

0 commit comments

Comments
 (0)