From 3132214f749e0731d4d573d8b2c2e1f952468c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Rami=CC=81rez=20Mondrago=CC=81n?= Date: Mon, 30 May 2022 21:51:16 -0500 Subject: [PATCH] chore: Use tox environments in matrix --- .github/workflows/test.yml | 61 +++++--------------------------------- tox.ini | 6 ++++ 2 files changed, 13 insertions(+), 54 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b06961b4c1..1ab11e0a06 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,10 +16,11 @@ jobs: fail-fast: false matrix: include: - - { python-version: "3.7", os: "ubuntu-latest" } - - { python-version: "3.8", os: "ubuntu-latest" } - - { python-version: "3.9", os: "ubuntu-latest" } - - { python-version: "3.10", os: "ubuntu-latest" } + - { tox-env: no_external, python-version: "3.7", os: "ubuntu-latest" } + - { tox-env: no_external, python-version: "3.8", os: "ubuntu-latest" } + - { tox-env: no_external, python-version: "3.9", os: "ubuntu-latest" } + - { tox-env: no_external, python-version: "3.10", os: "ubuntu-latest" } + - { tox-env: lint, python-version: "3.8", os: "ubuntu-latest" } steps: - name: Check out the repository @@ -51,54 +52,6 @@ jobs: poetry env use "${{ matrix.python-version }}" poetry install - # TODO: Run complete test suite. Requires setting up some repository secrets - - name: Run tests + - name: Run tox run: | - poetry run pytest --doctest-modules singer_sdk - poetry run pytest tests/core - poetry run pytest tests/cookiecutters - - # TODO: Avoid this repetition by leveraging Tox sessions - lint: - name: Lint on ${{ matrix.python-version }} / ${{ matrix.os }} - runs-on: ${{ matrix.os }} - continue-on-error: false - strategy: - fail-fast: false - matrix: - include: - - { python-version: "3.8", os: "ubuntu-latest" } - steps: - - name: Check out the repository - uses: actions/checkout@v3.0.2 - - - name: Install Poetry - env: - PIP_CONSTRAINT: .github/workflows/constraints.txt - run: | - pipx install poetry - poetry --version - - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v3.1.2 - with: - python-version: ${{ matrix.python-version }} - architecture: x64 - cache: 'poetry' - - - name: Upgrade pip - env: - PIP_CONSTRAINT: .github/workflows/constraints.txt - run: | - pip install pip - pip --version - - - name: Install Dependencies - run: | - poetry env use "${{ matrix.python-version }}" - poetry install - - - name: Run tests - run: | - poetry run tox -e lint + poetry run tox -e ${{ matrix.tox-env }} diff --git a/tox.ini b/tox.ini index 950835817f..fcc89ea9f2 100644 --- a/tox.ini +++ b/tox.ini @@ -33,6 +33,12 @@ commands = poetry run coverage html open ./htmlcov/index.html +[testenv:no_external] +commands = + poetry run pytest --doctest-modules singer_sdk + poetry run pytest tests/core + poetry run pytest tests/cookiecutters + [testenv:lint] commands = poetry run black --check --diff singer_sdk/ tests/ samples/