Skip to content

Commit 0ea2cd7

Browse files
committed
github: github actions migration
1 parent b895be0 commit 0ea2cd7

File tree

4 files changed

+170
-95
lines changed

4 files changed

+170
-95
lines changed

.github/workflows/pypi-publish.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
Publish:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.7
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install setuptools wheel
24+
- name: Build package
25+
run: |
26+
python setup.py sdist bdist_wheel
27+
- name: Publish on PyPI
28+
uses: pypa/[email protected]
29+
with:
30+
user: __token__
31+
password: ${{ secrets.pypi_token }}

.github/workflows/tests.yml

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: master
6+
pull_request:
7+
branches: master
8+
schedule:
9+
# * is a special character in YAML so you have to quote this string
10+
- cron: '0 3 * * 6'
11+
workflow_dispatch:
12+
inputs:
13+
reason:
14+
description: 'Reason'
15+
required: false
16+
default: 'Manual trigger'
17+
18+
jobs:
19+
Tests:
20+
runs-on: ubuntu-20.04
21+
strategy:
22+
matrix:
23+
python-version: [3.6, 3.7, 3.8, 3.9]
24+
requirements-level: [min, pypi]
25+
cache-service: [redis]
26+
db-service: [postgresql9, postgresql11, mysql5, mysql8]
27+
mq-service: [rabbitmq, redis]
28+
search-service: [elasticsearch6, elasticsearch7]
29+
30+
exclude:
31+
# Add combinations to this list that should be excluded from the final
32+
# build. Doing this will help keeping the number of jobs down.
33+
# E.g. removing 3.8 - min combination will avoid 8 jobs to be submited
34+
# [3.8] * [min] * [postgresql9, postgresql11, mysql5, mysql8] * [elasticsearch6, elasticsearch7]
35+
- python-version: 3.7
36+
requirements-level: min
37+
38+
- python-version: 3.8
39+
requirements-level: min
40+
41+
- python-version: 3.9
42+
requirements-level: min
43+
44+
- db-service: postgresql11
45+
python-version: 3.6
46+
47+
- db-service: mysql8
48+
python-version: 3.6
49+
50+
- search-service: elasticsearch7
51+
python-version: 3.6
52+
53+
- search-service: elasticsearch6
54+
db-service: postgresql11
55+
56+
- search-service: elasticsearch6
57+
db-service: mysql8
58+
59+
- search-service: elasticsearch7
60+
db-service: postgresql9
61+
62+
- search-service: elasticsearch7
63+
db-service: mysql5
64+
65+
include:
66+
- db-service: postgresql9
67+
DB_EXTRAS: "postgresql"
68+
69+
- db-service: postgresql11
70+
DB_EXTRAS: "postgresql"
71+
72+
- db-service: mysql5
73+
DB_EXTRAS: "mysql"
74+
75+
- db-service: mysql8
76+
DB_EXTRAS: "mysql"
77+
78+
- search-service: elasticsearch6
79+
SEARCH_EXTRAS: "elasticsearch6"
80+
81+
- search-service: elasticsearch7
82+
SEARCH_EXTRAS: "elasticsearch7"
83+
84+
env:
85+
CACHE: ${{ matrix.cache-service }}
86+
DB: ${{ matrix.db-service }}
87+
MQ: ${{ matrix.mq-service }}
88+
SEARCH: ${{ matrix.search-service }}
89+
EXTRAS: all,${{ matrix.DB_EXTRAS }},${{matrix.SEARCH_EXTRAS}}
90+
91+
steps:
92+
- name: Checkout
93+
uses: actions/checkout@v2
94+
95+
- name: Set up Python ${{ matrix.python-version }}
96+
uses: actions/setup-python@v2
97+
with:
98+
python-version: ${{ matrix.python-version }}
99+
100+
- name: Generate dependencies
101+
run: |
102+
python -m pip install --upgrade pip setuptools py wheel requirements-builder
103+
requirements-builder -e "$EXTRAS" --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
104+
105+
- name: Cache pip
106+
uses: actions/cache@v2
107+
with:
108+
path: ~/.cache/pip
109+
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}
110+
111+
- name: Install dependencies
112+
run: |
113+
pip install -r .${{matrix.requirements-level}}-${{ matrix.python-version }}-requirements.txt
114+
pip install ".[$EXTRAS]"
115+
pip freeze
116+
docker --version
117+
docker-compose --version
118+
119+
- name: Run tests
120+
run: |
121+
./run-tests.sh

.travis.yml

-91
This file was deleted.

run-tests.sh

+18-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,21 @@
77
# Invenio is free software; you can redistribute it and/or modify it
88
# under the terms of the MIT License; see LICENSE file for more details.
99

10-
check-manifest --ignore ".travis-*" && \
11-
sphinx-build -qnNW docs docs/_build/html && \
12-
pytest && \
13-
sphinx-build -qnNW -b doctest docs docs/_build/doctest
10+
# Quit on errors
11+
set -o errexit
12+
13+
# Quit on unbound symbols
14+
set -o nounset
15+
16+
# Always bring down services
17+
function cleanup {
18+
eval "$(docker-services-cli down --env)"
19+
}
20+
trap cleanup EXIT
21+
22+
python -m check_manifest --ignore ".*-requirements.txt"
23+
python -m sphinx.cmd.build -qnNW docs docs/_build/html
24+
eval "$(docker-services-cli up --db ${DB:-postgresql} --search ${SEARCH:-elasticsearch} --cache ${CACHE:-redis} --mq ${MQ:-rabbitmq} --env)"
25+
python -m pytest
26+
tests_exit_code=$?
27+
exit "$tests_exit_code"

0 commit comments

Comments
 (0)