|
1 |
| -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
2 |
| -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
3 |
| - |
4 |
| -name: Python package |
5 |
| - |
6 |
| -on: |
7 |
| - push: |
8 |
| - branches: [ master ] |
9 |
| - pull_request: |
10 |
| - branches: [ master ] |
11 |
| - |
12 |
| -jobs: |
13 |
| - build: |
14 |
| - |
15 |
| - runs-on: ubuntu-latest |
16 |
| - strategy: |
17 |
| - matrix: |
18 |
| - python-version: [3.5, 3.6, 3.7, 3.8] |
19 |
| - |
20 |
| - steps: |
21 |
| - - uses: actions/checkout@v2 |
22 |
| - - name: Set up Python ${{ matrix.python-version }} |
23 |
| - uses: actions/setup-python@v1 |
24 |
| - with: |
25 |
| - python-version: ${{ matrix.python-version }} |
26 |
| - - name: Install dependencies |
27 |
| - run: | |
28 |
| - python -m pip install --upgrade pip |
29 |
| - pip install -r requirements.txt |
30 |
| - - name: Lint with flake8 |
31 |
| - run: | |
32 |
| - pip install flake8 |
33 |
| - # stop the build if there are Python syntax errors or undefined names |
34 |
| - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
35 |
| - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
36 |
| - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
37 |
| - - name: Test with pytest |
38 |
| - run: | |
39 |
| - pip install pytest |
40 |
| - pytest |
| 1 | +--- |
| 2 | + name: CI |
| 3 | + |
| 4 | + on: |
| 5 | + push: |
| 6 | + branches: ["master"] |
| 7 | + pull_request: |
| 8 | + branches: ["master"] |
| 9 | + # Allow rebuilds via API. |
| 10 | + repository_dispatch: |
| 11 | + types: rebuild |
| 12 | + |
| 13 | + jobs: |
| 14 | + tests: |
| 15 | + name: "Python ${{ matrix.python-version }} on ${{ matrix.platform }}" |
| 16 | + runs-on: "${{ matrix.platform }}" |
| 17 | + env: |
| 18 | + USING_COVERAGE: '3.8' |
| 19 | + |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + platform: ["ubuntu-latest"] |
| 23 | + python-version: ["3.5", "3.6", "3.7", "3.8"] |
| 24 | + |
| 25 | + steps: |
| 26 | + - uses: "actions/checkout@v2" |
| 27 | + - uses: "actions/setup-python@v1" |
| 28 | + with: |
| 29 | + python-version: "${{ matrix.python-version }}" |
| 30 | + - name: "Install dependencies" |
| 31 | + run: | |
| 32 | + python -VV |
| 33 | + python -m site |
| 34 | + python -m pip install --upgrade pip setuptools wheel |
| 35 | + python -m pip install --upgrade virtualenv tox tox-gh-actions |
| 36 | +
|
| 37 | + - name: "Run tox targets for ${{ matrix.python-version }}" |
| 38 | + run: "python -m tox" |
| 39 | + env: |
| 40 | + PLATFORM: ${{ matrix.platform }} |
| 41 | + |
| 42 | + package: |
| 43 | + name: "Build & verify package" |
| 44 | + runs-on: "ubuntu-latest" |
| 45 | + |
| 46 | + steps: |
| 47 | + - uses: "actions/checkout@v2" |
| 48 | + - uses: "actions/setup-python@v1" |
| 49 | + with: |
| 50 | + python-version: "3.8" |
| 51 | + |
| 52 | + - name: "Install pep517 and twine" |
| 53 | + run: "python -m pip install pep517 twine" |
| 54 | + - name: "Build package" |
| 55 | + run: "python -m pep517.build --source --binary ." |
| 56 | + - name: "List result" |
| 57 | + run: "ls -l dist" |
| 58 | + - name: "Check long_description" |
| 59 | + run: "python -m twine check dist/*" |
| 60 | + |
| 61 | + install-dev: |
| 62 | + strategy: |
| 63 | + matrix: |
| 64 | + os: ["ubuntu-latest", "windows-latest", "macos-latest"] |
| 65 | + |
| 66 | + name: "Verify dev env" |
| 67 | + runs-on: "${{ matrix.os }}" |
| 68 | + |
| 69 | + steps: |
| 70 | + - uses: "actions/checkout@v2" |
| 71 | + - uses: "actions/setup-python@v1" |
| 72 | + with: |
| 73 | + python-version: "3.8" |
| 74 | + - name: "Install in dev mode" |
| 75 | + run: "python -m pip install -e .[dev]" |
| 76 | + - name: "Import package" |
| 77 | + run: "python -c 'import rest_framework_xml; print(rest_framework_xml.__version__)'" |
0 commit comments