Skip to content

Commit

Permalink
Fix: CI (#190)
Browse files Browse the repository at this point in the history
* creatign a new PR just to test actions

* uses default github action from strawberry repo

* making a test wrong to see if gets a error

* make test correct again

* take back poetry command

* another test

* test with coverage cml

* add coverage package

* change codecove version

* change order

* ops

* trying wiht no async to see whats wrong with xdist

* bring back async

* fix: BigInt raising errors

* add release md
  • Loading branch information
Ckk3 authored Oct 2, 2024
1 parent f9c09a1 commit 5b09eee
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 48 deletions.
84 changes: 36 additions & 48 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ jobs:
outputs:
sessions: ${{ steps.set-matrix.outputs.sessions }}
steps:
- uses: actions/checkout@v3
- uses: wntrblm/nox@main
- run: pipx install poetry
- run: pipx inject nox nox-poetry
- uses: actions/checkout@v4
- run: pip install poetry nox nox-poetry
- id: set-matrix
shell: bash
run: |
Expand All @@ -51,36 +49,25 @@ jobs:
session: ${{ fromJson(needs.generate-jobs-tests.outputs.sessions) }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ikalnytskyi/action-setup-postgres@v4
- uses: wntrblm/nox@main
with:
python-versions: "3.8, 3.9, 3.10, 3.11, 3.12"

- name: Pip and nox cache
id: cache
uses: actions/cache@v3
- uses: actions/setup-python@v5
with:
path: |
~/.cache
~/.nox
.nox
key: ${{ runner.os }}-nox-${{ matrix.session.session }}-${{
hashFiles('**/poetry.lock') }}-${{ hashFiles('**/noxfile.py') }}
restore-keys: |
${{ runner.os }}-nox-${{ matrix.session.session }}-
${{ runner.os }}-nox-
- run: pipx install coverage
- run: pipx install poetry
- run: pipx inject nox nox-poetry
python-version: |
3.8
3.9
3.10
3.11
3.12
3.13-dev
- run: pip install poetry nox nox-poetry coverage
- run: nox -r -t tests -s "${{ matrix.session.session }}"

- name: coverage xml
run: coverage xml -i
if: ${{ always() }}

- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
if: ${{ always() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -94,65 +81,66 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: pipx install poetry
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
id: setup-python
with:
python-version: "3.12.0-rc.2"
python-version: "3.12"
architecture: x64
cache: "poetry"

- run: poetry env use 3.12.0-rc.2
- run: poetry run pip install --upgrade pip setuptools wheel
- run: poetry env use 3.12
- run: poetry install
if: steps.setup-python.outputs.cache-hit != 'true'

- name: Run benchmarks
uses: CodSpeedHQ/action@v1
uses: CodSpeedHQ/action@v2
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: poetry run pytest tests/benchmarks --codspeed

lint:
name: ✨ Lint
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: wntrblm/nox@main
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-versions: "3.8, 3.9, 3.10, 3.11, 3.12"
python-version: |
3.8
3.9
3.10
3.11
3.12
- name: Pip and nox cache
id: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache
~/.nox
.nox
key: ${{ runner.os }}-nox-lint-${{ matrix.session.session }}-${{
key:
${{ runner.os }}-nox-lint-${{ env.pythonLocation }}-${{
hashFiles('**/poetry.lock') }}-${{ hashFiles('**/noxfile.py') }}
restore-keys: |
${{ runner.os }}-lint-nox-${{ matrix.session.session }}-
${{ runner.os }}-lint-nox-
${{ runner.os }}-nox-lint-${{ env.pythonLocation }}
- run: pipx install poetry
- run: pipx inject nox nox-poetry
- run: pip install poetry nox nox-poetry uv
- run: nox -r -t lint

unit-tests-on-windows:
name: 🪟 Tests on Windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: pipx install poetry
- run: pipx install coverage
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
id: setup-python
with:
python-version: "3.11"
Expand All @@ -164,14 +152,14 @@ jobs:

# we use poetry directly instead of nox since we want to
# test all integrations at once on windows
# but we want to exclude tests/mypy since we are using an old version of pydantic
- run: |
poetry run pytest --cov=. --cov-append --cov-report=xml -n auto --showlocals -vv
- name: coverage xml
run: coverage xml -i
if: ${{ always() }}

- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
if: ${{ always() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Release type: patch

Resolved an issue with the BigInt scalar definition, ensuring compatibility with Python 3.8 and 3.9. The missing name parameter was added to prevent runtime errors.
Fixed failing CI tests by updating the GitHub Actions workflow to improve test stability.
1 change: 1 addition & 0 deletions src/strawberry_sqlalchemy_mapper/scalars.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
serialize=lambda v: int(v),
parse_value=lambda v: str(v),
description="BigInt field",
name="BigInt",
)

0 comments on commit 5b09eee

Please sign in to comment.