-
Notifications
You must be signed in to change notification settings - Fork 58
68 lines (62 loc) · 2.1 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"
env:
USING_COVERAGE: '3.9'
strategy:
matrix:
python-version: ["3.6","3.7","3.8","3.9","pypy3"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
set -xe
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
pip install -r requirements.txt
- name: "Run unit tests for tox ${{ matrix.python-version }}"
run: |
python -m tox
pip install pytest
py.test tests
- name: "Convert coverage"
run: "python -m coverage xml"
if: "contains(env.USING_COVERAGE, matrix.python-version)"
- name: "Upload coverage to Codecov"
if: "contains(env.USING_COVERAGE, matrix.python-version)"
uses: "codecov/codecov-action@v1"
with:
fail_ci_if_error: true
# ensure Dev env works everywhere
install-dev:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
name: "Verify dev env"
runs-on: "${{ matrix.os }}"
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "3.9"
- name: "Install in dev mode"
run: "python -m pip install -e .[dev]"
- name: "Import package"
run: "python -c 'import http_request_randomizer; print(http_request_randomizer.__version__)'"