Skip to content

Commit

Permalink
chore: upgrade GitHub workflows (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszekhanusz authored Oct 28, 2024
1 parent e355261 commit c3b722e
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 37 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12
- name: Build wheel and source tarball
run: |
pip install wheel
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8"]
os: [ubuntu-20.04, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.10"]
os: [ubuntu-24.04, windows-latest]
exclude:
- os: windows-latest
python-version: "3.9"
Expand All @@ -20,12 +20,12 @@ jobs:
- os: windows-latest
python-version: "3.12"
- os: windows-latest
python-version: "pypy3.8"
python-version: "pypy3.10"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -38,18 +38,18 @@ jobs:
TOXENV: ${{ matrix.toxenv }}

single_extra:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
dependency: ["aiohttp", "requests", "httpx", "websockets"]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12
- name: Install dependencies with only ${{ matrix.dependency }} extra dependency
run: |
python -m pip install --upgrade pip wheel
Expand All @@ -58,19 +58,22 @@ jobs:
run: pytest tests --${{ matrix.dependency }}-only

coverage:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12
- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -e.[test]
- name: Test with coverage
run: pytest --cov=gql --cov-report=xml --cov-report=term-missing tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"parse==1.15.0",
"pytest==7.4.2",
"pytest-asyncio==0.21.1",
"pytest-console-scripts==1.3.1",
"pytest-console-scripts==1.4.1",
"pytest-cov==5.0.0",
"vcrpy==4.4.0",
"aiofiles",
Expand All @@ -26,7 +26,7 @@
dev_requires = [
"black==22.3.0",
"check-manifest>=0.42,<1",
"flake8==3.8.1",
"flake8==7.1.1",
"isort==4.3.21",
"mypy==1.10",
"sphinx>=5.3.0,<6",
Expand Down
3 changes: 2 additions & 1 deletion tests/test_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,8 @@ def test_code():
monkeypatch.setattr("sys.stdin", io.StringIO(query1_str))

ret = script_runner.run(
"gql-cli", url, "--verbose", stdin=io.StringIO(query1_str)
["gql-cli", url, "--verbose"],
stdin=io.StringIO(query1_str),
)

assert ret.success
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def test_cli_get_transport_no_protocol(parser):

@pytest.mark.script_launch_mode("subprocess")
def test_cli_ep_version(script_runner):
ret = script_runner.run("gql-cli", "--version")
ret = script_runner.run(["gql-cli", "--version"])

assert ret.success

Expand Down
3 changes: 2 additions & 1 deletion tests/test_httpx_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,8 @@ def test_code():
monkeypatch.setattr("sys.stdin", io.StringIO(query1_str))

ret = script_runner.run(
"gql-cli", url, "--verbose", stdin=io.StringIO(query1_str)
["gql-cli", url, "--verbose"],
stdin=io.StringIO(query1_str),
)

assert ret.success
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,37 @@ commands =
py{38}: pytest {posargs:tests --cov-report=term-missing --cov=gql}

[testenv:black]
basepython = python3.8
basepython = python
deps = -e.[dev]
commands =
black --check gql tests

[testenv:flake8]
basepython = python3.8
basepython = python
deps = -e.[dev]
commands =
flake8 gql tests

[testenv:import-order]
basepython = python3.8
basepython = python
deps = -e.[dev]
commands =
isort --recursive --check-only --diff gql tests

[testenv:mypy]
basepython = python3.8
basepython = python
deps = -e.[dev]
commands =
mypy gql tests

[testenv:docs]
basepython = python3.8
basepython = python
deps = -e.[dev]
commands =
sphinx-build -b html -nEW docs docs/_build/html

[testenv:manifest]
basepython = python3.8
basepython = python
deps = -e.[dev]
commands =
check-manifest -v

0 comments on commit c3b722e

Please sign in to comment.