|
2 | 2 | name: CI
|
3 | 3 |
|
4 | 4 | on:
|
5 |
| - push: |
6 |
| - branches: [master] |
7 |
| - tags: [v*] |
8 |
| - pull_request: |
9 |
| - branches: [master] |
10 |
| - workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: [master] |
| 7 | + tags: [v*] |
| 8 | + pull_request: |
| 9 | + branches: [master] |
| 10 | + workflow_dispatch: |
11 | 11 |
|
12 | 12 | jobs:
|
13 |
| - lint: |
14 |
| - name: Run linters |
15 |
| - runs-on: ubuntu-latest |
16 |
| - outputs: |
17 |
| - version: ${{ steps.version.outputs.version }} |
18 |
| - prerelease: ${{ steps.version.outputs.prerelease }} |
19 |
| - steps: |
20 |
| - - uses: actions/checkout@v2 |
21 |
| - with: |
22 |
| - fetch-depth: 0 |
23 |
| - - uses: actions/setup-python@v2 |
24 |
| - with: |
25 |
| - python-version: '3.9' |
26 |
| - - name: Install GitHub matcher for ActionLint checker |
27 |
| - run: | |
28 |
| - echo "::add-matcher::.github/actionlint-matcher.json" |
29 |
| - - name: Install check-wheel-content, and twine |
30 |
| - run: python -m pip install build check-wheel-contents tox twine |
31 |
| - - name: Build package |
32 |
| - run: python -m build |
33 |
| - - name: Run tox for linter |
34 |
| - run: python -m tox -e lint |
35 |
| - - name: List result |
36 |
| - run: ls -l dist |
37 |
| - - name: Check wheel contents |
38 |
| - run: check-wheel-contents dist/*.whl |
39 |
| - - name: Check long_description |
40 |
| - run: python -m twine check dist/* |
41 |
| - - name: Get version info |
42 |
| - id: version |
43 |
| - run: tox -e version-info |
44 |
| - - name: Upload artifacts |
45 |
| - uses: actions/upload-artifact@v2 |
46 |
| - with: |
47 |
| - name: dist |
48 |
| - path: dist |
| 13 | + lint: |
| 14 | + name: Run linters |
| 15 | + runs-on: ubuntu-latest |
| 16 | + outputs: |
| 17 | + version: ${{ steps.version.outputs.version }} |
| 18 | + prerelease: ${{ steps.version.outputs.prerelease }} |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + - uses: actions/setup-python@v2 |
| 24 | + with: |
| 25 | + python-version: '3.9' |
| 26 | + - name: Install GitHub matcher for ActionLint checker |
| 27 | + run: | |
| 28 | + echo "::add-matcher::.github/actionlint-matcher.json" |
| 29 | + - name: Install check-wheel-content, and twine |
| 30 | + run: python -m pip install build check-wheel-contents tox twine |
| 31 | + - name: Build package |
| 32 | + run: python -m build |
| 33 | + - name: Run tox for linter |
| 34 | + run: python -m tox -e lint |
| 35 | + - name: List result |
| 36 | + run: ls -l dist |
| 37 | + - name: Check wheel contents |
| 38 | + run: check-wheel-contents dist/*.whl |
| 39 | + - name: Check long_description |
| 40 | + run: python -m twine check dist/* |
| 41 | + - name: Get version info |
| 42 | + id: version |
| 43 | + run: tox -e version-info |
| 44 | + - name: Upload artifacts |
| 45 | + uses: actions/upload-artifact@v2 |
| 46 | + with: |
| 47 | + name: dist |
| 48 | + path: dist |
49 | 49 |
|
50 |
| - test: |
51 |
| - name: Python ${{ matrix.python-version }} |
52 |
| - runs-on: ubuntu-latest |
53 |
| - env: |
54 |
| - USING_COVERAGE: 3.7,3.8,3.9,3.10 |
| 50 | + test: |
| 51 | + name: Python ${{ matrix.python-version }} |
| 52 | + runs-on: ubuntu-latest |
| 53 | + env: |
| 54 | + USING_COVERAGE: 3.7,3.8,3.9,3.10 |
55 | 55 |
|
56 |
| - strategy: |
57 |
| - matrix: |
58 |
| - python-version: ['3.7', '3.8', '3.9', '3.10'] |
| 56 | + strategy: |
| 57 | + matrix: |
| 58 | + python-version: ['3.7', '3.8', '3.9', '3.10'] |
59 | 59 |
|
60 |
| - steps: |
61 |
| - - uses: actions/checkout@v2 |
62 |
| - with: |
63 |
| - fetch-depth: 0 |
64 |
| - - uses: actions/setup-python@v2 |
65 |
| - with: |
66 |
| - python-version: ${{ matrix.python-version }} |
67 |
| - - name: Install dependencies |
68 |
| - run: | |
69 |
| - set -xe |
70 |
| - python -VV |
71 |
| - python -m site |
72 |
| - python -m pip install --upgrade pip |
73 |
| - python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions |
74 |
| - - name: Run tox targets for ${{ matrix.python-version }} |
75 |
| - run: python -m tox |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v2 |
| 62 | + with: |
| 63 | + fetch-depth: 0 |
| 64 | + - uses: actions/setup-python@v2 |
| 65 | + with: |
| 66 | + python-version: ${{ matrix.python-version }} |
| 67 | + - name: Install dependencies |
| 68 | + run: | |
| 69 | + set -xe |
| 70 | + python -VV |
| 71 | + python -m site |
| 72 | + python -m pip install --upgrade pip |
| 73 | + python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions |
| 74 | + - name: Run tox targets for ${{ matrix.python-version }} |
| 75 | + run: python -m tox |
76 | 76 |
|
77 |
| - - name: Prepare coverage artifact |
78 |
| - if: ${{ contains(env.USING_COVERAGE, matrix.python-version) }} |
79 |
| - uses: aio-libs/prepare-coverage@v21.9.1 |
| 77 | + - name: Prepare coverage artifact |
| 78 | + if: ${{ contains(env.USING_COVERAGE, matrix.python-version) }} |
| 79 | + uses: aio-libs/prepare-coverage@v21.9.1 |
80 | 80 |
|
81 |
| - check: |
82 |
| - name: Check |
83 |
| - if: always() |
84 |
| - needs: [lint, test] |
85 |
| - runs-on: ubuntu-latest |
86 |
| - steps: |
87 |
| - - name: Decide whether the needed jobs succeeded or failed |
88 |
| - uses: re-actors/alls-green@release/v1 |
89 |
| - with: |
90 |
| - jobs: ${{ toJSON(needs) }} |
91 |
| - - name: Upload coverage |
92 |
| - uses: aio-libs/upload-coverage@v21.9.4 |
| 81 | + check: |
| 82 | + name: Check |
| 83 | + if: always() |
| 84 | + needs: [lint, test] |
| 85 | + runs-on: ubuntu-latest |
| 86 | + steps: |
| 87 | + - name: Decide whether the needed jobs succeeded or failed |
| 88 | + uses: re-actors/alls-green@release/v1 |
| 89 | + with: |
| 90 | + jobs: ${{ toJSON(needs) }} |
| 91 | + - name: Upload coverage |
| 92 | + uses: aio-libs/upload-coverage@v21.9.4 |
93 | 93 |
|
94 |
| - deploy: |
95 |
| - name: Deploy |
96 |
| - environment: release |
| 94 | + deploy: |
| 95 | + name: Deploy |
| 96 | + environment: release |
97 | 97 | # Run only on pushing a tag
|
98 |
| - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
99 |
| - needs: [lint, check] |
100 |
| - runs-on: ubuntu-latest |
101 |
| - steps: |
102 |
| - - name: Install pandoc |
103 |
| - run: | |
104 |
| - sudo apt-get install -y pandoc |
105 |
| - - name: Checkout |
106 |
| - uses: actions/checkout@v2.4.0 |
107 |
| - with: |
108 |
| - fetch-depth: 0 |
109 |
| - - name: Download distributions |
110 |
| - uses: actions/download-artifact@v2 |
111 |
| - with: |
112 |
| - name: dist |
113 |
| - path: dist |
114 |
| - - name: Collected dists |
115 |
| - run: | |
116 |
| - tree dist |
117 |
| - - name: Convert README.rst to Markdown |
118 |
| - run: | |
119 |
| - pandoc -s -o README.md README.rst |
120 |
| - - name: PyPI upload |
121 |
| - uses: pypa/gh-action-pypi-publish@v1.4.2 |
122 |
| - with: |
123 |
| - packages_dir: dist |
124 |
| - password: ${{ secrets.PYPI_API_TOKEN }} |
125 |
| - - name: GitHub Release |
126 |
| - uses: ncipollo/release-action@v1 |
127 |
| - with: |
128 |
| - name: pytest-asyncio ${{ needs.lint.outputs.version }} |
129 |
| - artifacts: dist/* |
130 |
| - bodyFile: README.md |
131 |
| - prerelease: ${{ needs.lint.outputs.prerelease }} |
132 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 99 | + needs: [lint, check] |
| 100 | + runs-on: ubuntu-latest |
| 101 | + steps: |
| 102 | + - name: Install pandoc |
| 103 | + run: | |
| 104 | + sudo apt-get install -y pandoc |
| 105 | + - name: Checkout |
| 106 | + uses: actions/checkout@v2.4.0 |
| 107 | + with: |
| 108 | + fetch-depth: 0 |
| 109 | + - name: Download distributions |
| 110 | + uses: actions/download-artifact@v2 |
| 111 | + with: |
| 112 | + name: dist |
| 113 | + path: dist |
| 114 | + - name: Collected dists |
| 115 | + run: | |
| 116 | + tree dist |
| 117 | + - name: Convert README.rst to Markdown |
| 118 | + run: | |
| 119 | + pandoc -s -o README.md README.rst |
| 120 | + - name: PyPI upload |
| 121 | + uses: pypa/gh-action-pypi-publish@v1.4.2 |
| 122 | + with: |
| 123 | + packages_dir: dist |
| 124 | + password: ${{ secrets.PYPI_API_TOKEN }} |
| 125 | + - name: GitHub Release |
| 126 | + uses: ncipollo/release-action@v1 |
| 127 | + with: |
| 128 | + name: pytest-asyncio ${{ needs.lint.outputs.version }} |
| 129 | + artifacts: dist/* |
| 130 | + bodyFile: README.md |
| 131 | + prerelease: ${{ needs.lint.outputs.prerelease }} |
| 132 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments