diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b8ca0912..c57860da 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -33,5 +33,7 @@ jobs: - name: Release uses: softprops/action-gh-release@v2 with: - files: dist/* + files: | + dist/*.whl + dist/*.tar.gz generate_release_notes: true diff --git a/.github/workflows/test-suite.yaml b/.github/workflows/test-suite.yaml new file mode 100644 index 00000000..5c2a4599 --- /dev/null +++ b/.github/workflows/test-suite.yaml @@ -0,0 +1,54 @@ +name: Test Suite + +on: + workflow_call: + inputs: + test-type: + required: true + type: string + +jobs: + run: + runs-on: ubuntu-latest + + env: + TEST_TYPE: ${{ inputs.test-type }} + AWS_DEFAULT_REGION: us-west-2 + AWS_ATHENA_S3_STAGING_DIR: s3://laughingman7743-pyathena/github/ + AWS_ATHENA_WORKGROUP: pyathena + AWS_ATHENA_SPARK_WORKGROUP: pyathena-spark + AWS_ATHENA_MANAGED_WORKGROUP: pyathena-managed + + strategy: + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: astral-sh/setup-uv@v5 + with: + python-version: ${{ matrix.python-version }} + enable-cache: true + # TODO: In the case of Python 3.13+, the following error occurs, so install Python using setup-python. + # ../meson.build:44:2: ERROR: Problem encountered: Cannot compile + # `Python.h`. Perhaps you need to install python-dev|python-devel + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + if: matrix.python-version == '3.13' || matrix.python-version == '3.14' + - run: | + make tool + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::676287850544:role/github-actions-oidc-pyathena + role-session-name: PyAthenaTestSession + aws-region: ${{ env.AWS_DEFAULT_REGION }} + + - name: Test + run: | + make tox diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 504b0b50..8e4a31c4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,7 +1,7 @@ name: Test on: - push: + pull_request: schedule: - cron: '0 0 * * 0' @@ -11,45 +11,18 @@ permissions: jobs: test: - runs-on: ubuntu-latest - - env: - AWS_DEFAULT_REGION: us-west-2 - AWS_ATHENA_S3_STAGING_DIR: s3://laughingman7743-pyathena/github/ - AWS_ATHENA_WORKGROUP: pyathena - AWS_ATHENA_SPARK_WORKGROUP: pyathena-spark - AWS_ATHENA_MANAGED_WORKGROUP: pyathena-managed - - strategy: - fail-fast: false - matrix: - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - uses: astral-sh/setup-uv@v5 - with: - python-version: ${{ matrix.python-version }} - enable-cache: true - # TODO: In the case of Python 3.13+, the following error occurs, so install Python using setup-python. - # ../meson.build:44:2: ERROR: Problem encountered: Cannot compile - # `Python.h`. Perhaps you need to install python-dev|python-devel - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - if: matrix.python-version == '3.13' || matrix.python-version == '3.14' - - run: | - make tool - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::676287850544:role/github-actions-oidc-pyathena - role-session-name: PyAthenaTestSession - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - - name: Test - run: | - make tox + uses: ./.github/workflows/test-suite.yaml + with: + test-type: pyathena + + test-sqla: + needs: [test] + uses: ./.github/workflows/test-suite.yaml + with: + test-type: sqla + + test-sqla-async: + needs: [test-sqla] + uses: ./.github/workflows/test-suite.yaml + with: + test-type: sqla_async diff --git a/pyproject.toml b/pyproject.toml index d591f43f..cdb0a631 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -178,7 +178,7 @@ exclude = [ legacy_tox_ini = """ [tox] isolated_build = true -envlist = py{310,311,312,313,314} +envlist = py{310,311,312,313,314}-{pyathena,sqla,sqla_async} [gh-actions] python = @@ -188,6 +188,12 @@ python = 3.13: py313 3.14: py314 +[gh-actions:env] +TEST_TYPE = + pyathena: pyathena + sqla: sqla + sqla_async: sqla_async + [testenv] allowlist_externals = uv @@ -195,9 +201,9 @@ allowlist_externals = make commands = uv sync --group dev - make test - make test-sqla - make test-sqla-async + pyathena: make test + sqla: make test-sqla + sqla_async: make test-sqla-async passenv = TOXENV AWS_*