-
-
Notifications
You must be signed in to change notification settings - Fork 249
78 lines (66 loc) · 2.58 KB
/
python-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
pre_job:
# Cancels all other running workflow runs. We don't want to have two parallel test
# suites running against the test server.
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
build:
# Install all requirements, run the test suite, and clean up the server test account.
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10-dev']
max-parallel: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Unencrypt secret file
env:
AES_256_CBC_PASS: ${{ secrets.AES_256_CBC_PASS }}
# Only repo owners have access to the secret. PRs will run only the unit tests
if: env.AES_256_CBC_PASS != ''
run: |
openssl aes-256-cbc -d -in settings.yml.ghenc -out settings.yml -pass env:AES_256_CBC_PASS
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install cutting-edge Cython-based packages on Python dev versions
if: matrix.python-version == '3.10-dev'
run: |
sudo apt-get install libxml2-dev libxslt1-dev
python -m pip install hg+https://foss.heptapod.net/pypy/cffi
python -m pip install git+https://github.com/cython/cython.git
python -m pip install git+https://github.com/lxml/lxml.git
python -m pip install git+https://github.com/yaml/pyyaml.git
- name: Install dependencies
run: |
python -m pip install .
python -m pip install PyYAML requests_mock psutil coverage coveralls flake8 python-dateutil pytz unittest-parallel
- name: Test with coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
unittest-parallel -j 4 --coverage --coverage-source exchangelib
coveralls --service=github
- name: Clean up test account
# Only spend time running this once
if: matrix.python-version == '3.9'
run: |
PYTHONPATH=./ python scripts/wipe_test_account.py