Skip to content

Commit b220fae

Browse files
authored
Merge: Github Actions CI/CD tests for project
Github Actions CI/CD tests for project
2 parents 4f983d2 + 88e7c80 commit b220fae

File tree

3 files changed

+83
-26
lines changed

3 files changed

+83
-26
lines changed

.github/workflows/main.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- "*"
9+
pull_request:
10+
branches:
11+
- "*"
12+
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
mongodb-version: [3.6, 4.0, 4.2]
20+
21+
include:
22+
- name: "linting"
23+
python: "3.8"
24+
os: ubuntu-latest
25+
tox_env: "lint"
26+
mongodb-version: 4.2
27+
28+
- name: "ubuntu-py36"
29+
python: "3.6"
30+
os: ubuntu-latest
31+
tox_env: "py36"
32+
- name: "ubuntu-py37"
33+
python: "3.7"
34+
os: ubuntu-latest
35+
tox_env: "py37"
36+
- name: "ubuntu-py38"
37+
python: "3.8"
38+
os: ubuntu-latest
39+
tox_env: "py38"
40+
- name: "ubuntu-pypy3"
41+
python: "pypy3"
42+
os: ubuntu-latest
43+
tox_env: "pypy3"
44+
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Set up Python ${{ matrix.python }}
48+
uses: actions/setup-python@v1
49+
with:
50+
python-version: ${{ matrix.python }}
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install tox virtualenv
55+
- name: Start MongoDB
56+
uses: supercharge/mongodb-github-action@1.3.0
57+
with:
58+
mongodb-version: ${{ matrix.mongodb-version }}
59+
- name: Test build
60+
run: "tox -e ${{ matrix.tox_env }}"

.travis.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
# Use a container-based environment
2-
sudo: false
1+
dist: xenial
2+
os: linux
33

44
language: python
55

6-
python:
7-
- '3.6'
8-
- '3.7'
9-
- '3.8'
10-
- pypy3
11-
126
jobs:
137
include:
148
- language: python
159
python: 3.6
1610
name: "linting"
17-
script:
18-
- tox -e lint
19-
20-
env:
21-
- MONGOENGINE=latest_pip
22-
- MONGOENGINE=dev
11+
env: TOXENV=lint
12+
- language: python
13+
python: 3.6
14+
name: "Test on python 3.6"
15+
env: TOXENV=py36
16+
- language: python
17+
python: 3.7
18+
name: "Test on python 3.7"
19+
env: TOXENV=py37
20+
- language: python
21+
python: 3.8
22+
name: "Test on python 3.8"
23+
env: TOXENV=py38
24+
- language: python
25+
python: pypy3
26+
name: "Test on python pypy3"
27+
env: TOXENV=pypy3
2328

2429
services:
2530
- mongodb
@@ -31,11 +36,8 @@ install:
3136
- travis_retry pip install tox>=3.14
3237
- travis_retry pip install virtualenv
3338

34-
# Cache dependencies installed via pip
35-
cache: pip
36-
3739
script:
38-
- tox -e $(echo py$TRAVIS_PYTHON_VERSION-me_$MONGOENGINE | tr -d . | sed -e 's/pypypy/pypy/') -- --with-coverage
40+
- tox
3941

4042
after_success:
4143
- coveralls --verbose
@@ -60,11 +62,8 @@ deploy:
6062
distributions: "sdist bdist_wheel"
6163

6264
# only deploy on tagged commits (aka GitHub releases) and only for the
63-
# parent repo's builds running Python 2.7 along with dev MongoEngine (we run
64-
# Travis against many different Python and MongoEngine versions and we don't
65-
# want the deploy to occur multiple times).
65+
# parent repo's builds running Python 3.6
6666
on:
6767
tags: true
68-
condition: "$MONGOENGINE = dev"
69-
python: 3.5
68+
python: 3.6
7069
repo: MongoEngine/flask-mongoengine

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
[tox]
2-
envlist = {py36,py37,py38,pypy3}-{me_latest_pip,me_dev},lint
2+
envlist = {py36,py37,py38,pypy3},lint
33

44
[testenv]
55
commands =
66
python -m pytest
77
deps =
8-
me_latest_pip: mongoengine>=0.19.0
9-
me_dev: https://github.com/MongoEngine/mongoengine/tarball/master
108
PyMongo>3.9.0
119
pytest
1210
pytest-cov

0 commit comments

Comments
 (0)