1+ name : MongoengineCI
2+ on :
3+ # All PR
4+ pull_request :
5+ # master branch merge
6+ push :
7+ branches :
8+ - master
9+ # release tags
10+ create :
11+ tags :
12+ - ' v[0-9]+\.[0-9]+\.[0-9]+*'
13+ env :
14+ MONGODB_3_4 : 3.4.19
15+ MONGODB_3_6 : 3.6.13
16+ MONGODB_4_0 : 4.0.13
17+
18+ PYMONGO_3_4 : 3.4
19+ PYMONGO_3_6 : 3.6
20+ PYMONGO_3_9 : 3.9
21+ PYMONGO_3_11 : 3.11
22+
23+ MAIN_PYTHON_VERSION : 3.7
24+
25+ jobs :
26+ linting :
27+ runs-on : ubuntu-latest
28+ steps :
29+ - uses : actions/checkout@v2
30+ - name : Set up Python 3.7
31+ uses : actions/setup-python@v2
32+ with :
33+ python-version : 3.7
34+ - run : bash .github/workflows/install_ci_python_dep.sh
35+ - run : pre-commit run -a
36+
37+ test :
38+ # Test suite run against recent python versions
39+ # and against a few combination of MongoDB and pymongo
40+ runs-on : ubuntu-latest
41+ strategy :
42+ fail-fast : false
43+ matrix :
44+ python-version : [3.6, 3.7, 3.8, 3.9, pypy3]
45+ MONGODB : [$MONGODB_4_0]
46+ PYMONGO : [$PYMONGO_3_11]
47+ include :
48+ - python-version : 3.7
49+ MONGODB : $MONGODB_3_4
50+ PYMONGO : $PYMONGO_3_6
51+ - python-version : 3.7
52+ MONGODB : $MONGODB_3_6
53+ PYMONGO : $PYMONGO_3_9
54+ - python-version : 3.7
55+ MONGODB : $MONGODB_3_6
56+ PYMONGO : $PYMONGO_3_11
57+ steps :
58+ - uses : actions/checkout@v2
59+ - name : Set up Python ${{ matrix.python-version }}
60+ uses : actions/setup-python@v2
61+ with :
62+ python-version : ${{ matrix.python-version }}
63+ - name : install mongo and ci dependencies
64+ run : |
65+ bash .github/workflows/install_mongo.sh ${{ matrix.MONGODB }}
66+ bash .github/workflows/install_ci_python_dep.sh
67+ bash .github/workflows/start_mongo.sh ${{ matrix.MONGODB }}
68+ - name : tox dry-run (to pre-install venv)
69+ run : tox -e $(echo py${{ matrix.python-version }}-mg${{ matrix.PYMONGO }} | tr -d . | sed -e 's/pypypy/pypy/') -- -a "-k=test_ci_placeholder"
70+ - name : Run test suite
71+ run : tox -e $(echo py${{ matrix.python-version }}-mg${{ matrix.PYMONGO }} | tr -d . | sed -e 's/pypypy/pypy/') -- -a "--cov=mongoengine"
72+ - name : Send coverage to Coveralls
73+ env :
74+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75+ if : ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
76+ run : coveralls
77+
78+ build_doc_dryrun :
79+ # ensures that readthedocs can be built continuously
80+ # to avoid that it breaks when new releases are being created
81+ runs-on : ubuntu-latest
82+ steps :
83+ - uses : actions/checkout@v2
84+ - name : Set up Python ${{ matrix.python-version }}
85+ uses : actions/setup-python@v2
86+ with :
87+ python-version : 3.7
88+ - name : install python dep
89+ run : |
90+ pip install -e .
91+ pip install -r docs/requirements.txt
92+ - name : build doc
93+ run : |
94+ cd docs
95+ make html-readthedocs
96+
97+ irc_notification :
98+ runs-on : ubuntu-latest
99+ needs : [linting, test]
100+ steps :
101+ - uses : rectalogic/notify-irc@v1
102+ if : success()
103+ with :
104+ channel : " irc.freenode.org#mongoengine"
105+ nickname : github-notifier
106+ message : |
107+ Build ${{ job.status }} - ${{ github.actor }} ${{ github.event_name }} ${{ github.event.ref }}
108+
109+ build-n-publish-dummy :
110+ runs-on : ubuntu-latest
111+ needs : [linting, test]
112+ steps :
113+ - uses : actions/checkout@master
114+ - name : Set up Python 3.7
115+ uses : actions/setup-python@v1
116+ with :
117+ python-version : 3.7
118+ - name : build dummy wheel for test-pypi
119+ run : |
120+ pip install wheel
121+ python setup.py egg_info -b ".dev`date '+%Y%m%d%H%M%S'`" build sdist bdist_wheel
122+ # - name: publish test-pypi
123+ # # Although working and recommended, test-pypi has a limit
124+ # # in the size of projects so it's better to avoid publishing
125+ # # until there is a way to garbage collect these dummy releases
126+ # if: github.event_name != 'pull_request'
127+ # uses: pypa/gh-action-pypi-publish@master
128+ # with:
129+ # password: ${{ secrets.test_pypi_token }}
130+ # repository_url: https://test.pypi.org/legacy/
131+
132+ build-n-publish :
133+ runs-on : ubuntu-latest
134+ needs : [linting, test]
135+ if : github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v')
136+ steps :
137+ - uses : actions/checkout@master
138+ - name : Set up Python 3.7
139+ uses : actions/setup-python@v1
140+ with :
141+ python-version : 3.7
142+ # todo separate build from publish
143+ # https://stackoverflow.com/questions/59349905/which-properties-does-github-event-in-a-github-workflow-have
144+ - name : build dummy wheel for test-pypi
145+ run : |
146+ pip install wheel
147+ python setup.py sdist bdist_wheel
148+ - name : publish pypi
149+ uses : pypa/gh-action-pypi-publish@master
150+ with :
151+ password : ${{ secrets.pypi_token }}
0 commit comments