Skip to content

Commit 42ed65c

Browse files
committed
Revert "ci: refactor jobs and improve platform coverage (danielgtaylor#128)"
This reverts commit 43c134d
1 parent 7f2b6e6 commit 42ed65c

File tree

4 files changed

+57
-108
lines changed

4 files changed

+57
-108
lines changed

.github/workflows/ci.yml

+57-52
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,74 @@
11
name: CI
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- '**'
3+
on: [push, pull_request]
104

115
jobs:
12-
tests:
13-
name: ${{ matrix.os }} / ${{ matrix.python-version }}
14-
runs-on: ${{ matrix.os }}-latest
15-
strategy:
16-
matrix:
17-
os: [Ubuntu, MacOS, Windows]
18-
python-version: [3.6, 3.7, 3.8]
19-
exclude:
20-
- os: Windows
21-
python-version: 3.6
6+
7+
check-formatting:
8+
runs-on: ubuntu-latest
9+
10+
name: Consult black on python formatting
11+
2212
steps:
2313
- uses: actions/checkout@v2
24-
25-
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v1
14+
- uses: actions/setup-python@v2
2715
with:
28-
python-version: ${{ matrix.python-version }}
16+
python-version: 3.7
17+
- uses: Gr1N/setup-poetry@v2
18+
- uses: actions/cache@v2
19+
with:
20+
path: ~/.cache/pypoetry/virtualenvs
21+
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
22+
restore-keys: |
23+
${{ runner.os }}-poetry-
24+
- name: Install dependencies
25+
run: poetry install
26+
- name: Run black
27+
run: poetry run poe check-style
2928

30-
- name: Get full Python version
31-
id: full-python-version
32-
shell: bash
33-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
29+
run-tests:
30+
runs-on: ubuntu-latest
3431

35-
- name: Install poetry
36-
shell: bash
37-
run: |
38-
python -m pip install poetry
39-
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
32+
name: Run tests with tox
4033

41-
- name: Configure poetry
42-
shell: bash
43-
run: poetry config virtualenvs.in-project true
34+
strategy:
35+
matrix:
36+
python-version: [ '3.6', '3.7', '3.8']
4437

45-
- name: Set up cache
46-
uses: actions/cache@v2
47-
id: cache
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: actions/setup-python@v2
4841
with:
49-
path: .venv
50-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
51-
52-
- name: Ensure cache is healthy
53-
if: steps.cache.outputs.cache-hit == 'true'
54-
shell: bash
55-
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
56-
42+
python-version: ${{ matrix.python-version }}
43+
- uses: Gr1N/setup-poetry@v2
44+
- uses: actions/cache@v2
45+
with:
46+
path: ~/.cache/pypoetry/virtualenvs
47+
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-poetry-
5750
- name: Install dependencies
58-
shell: bash
5951
run: |
60-
poetry run python -m pip install pip -U
52+
poetry run pip install --upgrade pip
6153
poetry install
54+
- name: Run tests
55+
run: |
56+
poetry run poe generate
57+
poetry run poe test
6258
63-
- name: Generate code from proto files
64-
shell: bash
65-
run: poetry run python -m tests.generate -v
59+
build-release:
60+
runs-on: ubuntu-latest
6661

67-
- name: Execute test suite
68-
shell: bash
69-
run: poetry run pytest tests/
62+
steps:
63+
- uses: actions/checkout@v2
64+
- uses: actions/setup-python@v2
65+
with:
66+
python-version: 3.7
67+
- uses: Gr1N/setup-poetry@v2
68+
- name: Build package
69+
run: poetry build
70+
- name: Publish package to PyPI
71+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
72+
run: poetry publish -n
73+
env:
74+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.pypi }}

.github/workflows/code-quality.yml

-20
This file was deleted.

.github/workflows/release.yml

-31
This file was deleted.

tests/generate.py

-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import asyncio
33
import os
44
from pathlib import Path
5-
import platform
65
import shutil
76
import sys
87
from typing import Set
@@ -135,10 +134,6 @@ def main():
135134
else:
136135
verbose = False
137136
whitelist = set(sys.argv[1:])
138-
139-
if platform.system() == "Windows":
140-
asyncio.set_event_loop(asyncio.ProactorEventLoop())
141-
142137
asyncio.get_event_loop().run_until_complete(generate(whitelist, verbose))
143138

144139

0 commit comments

Comments
 (0)