-
Notifications
You must be signed in to change notification settings - Fork 321
122 lines (121 loc) · 4.35 KB
/
ci.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: CI
on:
pull_request:
jobs:
CI:
continue-on-error: true
runs-on: ${{ matrix.os }}
# Supported Versions:
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
strategy:
matrix:
os: [macos-13, windows-latest]
python-version: [3.6, 3.7, 3.8, pypy-3.7]
exclude:
- os: windows-latest
python-version: 3.6
include:
- os: ubuntu-20.04
python-version: 3.7
- os: ubuntu-20.04
python-version: 2.7
steps:
- uses: actions/checkout@v2
- if: ${{ matrix.python-version == '2.7' }}
name: Setup Python environment (2.7)
run: |
sudo apt-get install python-is-python2
curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
- if: ${{ matrix.python-version != '2.7' }}
name: Setup Python environment
uses: actions/setup-python@v3.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Install Requirements
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt
pip install -r test/requirements.txt
python setup.py install --user
- name: Run Linter
run: |
flake8 setup.py dropbox example test
- name: Run Unit Tests
run: |
pytest -v test/unit/test_dropbox_unit.py
Docs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Python environment
uses: actions/setup-python@v3.1.4
with:
python-version: '3.7'
- name: Install Requirements
run: |
python -m pip install --upgrade pip
pip install twine sphinx
pip install -r requirements.txt
pip install -r test/requirements.txt
python setup.py install
- name: Test Doc Generation
run: |
sphinx-build -b html docs build/html
- name: Test Dist Generation
run: |
python setup.py sdist bdist_wheel
twine check dist/*
Integration:
continue-on-error: true
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, windows-latest]
python-version: [3.6, 3.7, 3.8, pypy-3.7]
exclude:
- os: windows-latest
python-version: 3.6
include:
- os: ubuntu-20.04
python-version: 3.7
- os: ubuntu-20.04
python-version: 2.7
steps:
- uses: actions/checkout@v2.3.4
- if: ${{ matrix.python-version == '2.7' }}
name: Setup Python environment (2.7)
run: |
sudo apt-get install python-is-python2
curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
- if: ${{ matrix.python-version != '2.7' }}
name: Setup Python environment
uses: actions/setup-python@v3.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Install Requirements
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt
pip install -r test/requirements.txt
python setup.py install --user
- name: Run Integration Tests
env:
LEGACY_USER_DROPBOX_TOKEN: ${{ secrets.LEGACY_USER_DROPBOX_TOKEN }}
LEGACY_USER_CLIENT_ID: ${{ secrets.LEGACY_USER_CLIENT_ID }}
LEGACY_USER_CLIENT_SECRET: ${{ secrets.LEGACY_USER_CLIENT_SECRET }}
LEGACY_USER_REFRESH_TOKEN: ${{ secrets.LEGACY_USER_REFRESH_TOKEN }}
SCOPED_USER_DROPBOX_TOKEN: ${{ secrets.SCOPED_USER_DROPBOX_TOKEN }}
SCOPED_USER_CLIENT_ID: ${{ secrets.SCOPED_USER_CLIENT_ID }}
SCOPED_USER_CLIENT_SECRET: ${{ secrets.SCOPED_USER_CLIENT_SECRET }}
SCOPED_USER_REFRESH_TOKEN: ${{ secrets.SCOPED_USER_REFRESH_TOKEN }}
SCOPED_TEAM_DROPBOX_TOKEN: ${{ secrets.SCOPED_TEAM_DROPBOX_TOKEN }}
SCOPED_TEAM_CLIENT_ID: ${{ secrets.SCOPED_TEAM_CLIENT_ID }}
SCOPED_TEAM_CLIENT_SECRET: ${{ secrets.SCOPED_TEAM_CLIENT_SECRET }}
SCOPED_TEAM_REFRESH_TOKEN: ${{ secrets.SCOPED_TEAM_REFRESH_TOKEN }}
DROPBOX_SHARED_LINK: ${{ secrets.DROPBOX_SHARED_LINK }}
run: |
pytest -v test/integration/test_dropbox.py