Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies 2024-05-16 #134

Merged
merged 22 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build & Publish

on:
workflow_call:
secrets:
PYPI_TOKEN:
required: true

jobs:

cd-job:
name: Continues Delivery
runs-on: ubuntu-latest
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved
steps:

- name: SCM Checkout
uses: actions/checkout@v3
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Build Artifacts
run: poetry build

- name: PyPi Release
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__"
POETRY_HTTP_BASIC_PYPI_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
run: poetry publish

- name: GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
gh release create ${GITHUB_REF_NAME}
--title ${GITHUB_REF_NAME}
--notes-file ./doc/changes/changes_${GITHUB_REF_NAME}.md
dist/*
21 changes: 21 additions & 0 deletions .github/workflows/check-release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Release Tag

on: workflow_call

jobs:

check-tag-version-job:

name: Check Tag Version
runs-on: ubuntu-latest

steps:
- name: SCM Checkout
uses: actions/checkout@v3

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Check Tag Version
# make sure the pushed/created tag matched the project version
run: "[[ `poetry version --short` == ${{ github.ref_name }} ]]"
101 changes: 101 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Checks

on: workflow_call

jobs:

version-check-job:
name: Version Check
runs-on: ubuntu-latest

steps:
- name: SCM Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Check Version(s)
run: poetry run version-check exasol/bucketfs/version.py

build-documentation-job:
name: Build Documentation
needs: [version-check-job]
runs-on: ubuntu-latest

steps:
- name: SCM Checkout
uses: actions/checkout@v3

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Build Documentation
run: |
poetry run python -m nox -s build-docs

lint-job:
name: Linting (Python-${{ matrix.python-version }})
needs: [version-check-job]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: SCM Checkout
uses: actions/checkout@v3

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Run Tests
run: poetry run nox -s lint

type-check-job:
name: Type Checking (Python-${{ matrix.python-version }})
needs: [version-check-job]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: SCM Checkout
uses: actions/checkout@v3

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Run Tests
run: poetry run nox -s type-check

tests-job:
name: Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
needs: [build-documentation-job, lint-job, type-check-job]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
exasol-version: ["7.1.9"]
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: SCM Checkout
uses: actions/checkout@v3

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Run Tests
run: poetry run nox -s coverage -- -- --db-version ${{ matrix.exasol-version }}
14 changes: 9 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:

check-tag-version-job:
name: Check Release Tag
uses: exasol/python-toolbox/.github/workflows/check-release-tag.yml@0.3.0
uses: ./.github/workflows/check-release-tag.yml

ci-job:
name: Checks
needs: [ check-tag-version-job ]
uses: exasol/python-toolbox/.github/workflows/checks.yml@0.3.0
uses: ./.github/workflows/checks.yml

tests-job:
name: Tests (Python-${{ matrix.python-version }})
Expand Down Expand Up @@ -48,8 +48,12 @@ jobs:
run: poetry run pytest tests

cd-job:
name: Continues Delivery
needs: [ ci-job, tests-job ]
uses: exasol/python-toolbox/.github/workflows/build-and-publish.yml@0.3.0
name: Continuous Delivery
needs: [ ci-job ]
uses: ./.github/workflows/build-and-publish.yml
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

ci-job:
name: Checks
uses: exasol/python-toolbox/.github/workflows/checks.yml@0.3.0
uses: ./.github/workflows/checks.yml

tests-job:
name: Tests (Python-${{ matrix.python-version }})
Expand Down Expand Up @@ -64,3 +64,7 @@ jobs:
SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }}
run: poetry run pytest test_saas


metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml
27 changes: 27 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Documentation

on: workflow_call

jobs:

documentation-job:
runs-on: ubuntu-latest

steps:
- name: SCM Checkout
uses: actions/checkout@v3

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Build Documentation
run: |
poetry run python -m nox -s build-docs

- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: .html-documentation
git-config-name: Github Action
git-config-email: [email protected]
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ jobs:

ci-job:
name: Checks
uses: exasol/python-toolbox/.github/workflows/[email protected]
uses: ./.github/workflows/checks.yml

publish-docs:
name: Publish Documentation
uses: ./.github/workflows/gh-pages.yml

metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml

tests-job:
name: Tests (Python-${{ matrix.python-version }})
Expand Down Expand Up @@ -43,6 +51,3 @@ jobs:
- name: Run Tests
run: poetry run pytest tests

publish-docs:
name: Publish Documentation
uses: exasol/python-toolbox/.github/workflows/[email protected]
54 changes: 54 additions & 0 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Status Report

on:
workflow_call:
secrets:
ALTERNATIVE_GITHUB_TOKEN:
required: false

jobs:

report:
name: Generate Status Report
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}

steps:
- name: SCM Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts

- name: Copy Artifacts into Root Folder
working-directory: ./artifacts
run: |
ls -al ./artifacts
cp .artifacts/.coverage ../
cp .artifacts/.lint.txt ../

- name: Generate Report
run: poetry run nox -s report -- -- --format json | tee metrics.json

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: metrics.json
path: metrics.json

- name: Generate GitHub Summary
run: |
echo -e "# Summary\n" >> $GITHUB_STEP_SUMMARY
poetry run nox -s report -- -- --format markdown >> $GITHUB_STEP_SUMMARY
echo -e "\n\n# Coverage\n" >> $GITHUB_STEP_SUMMARY
poetry run coverage report -- --format markdown >> $GITHUB_STEP_SUMMARY
echo -e "\n\n# Static Code Analysis\n" >> $GITHUB_STEP_SUMMARY
cat .lint.txt >> $GITHUB_STEP_SUMMARY
6 changes: 5 additions & 1 deletion doc/changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Unreleased
# Unreleased

## Internal
- Updated lockfile
- Update workflows based on workflow templates of exasol-toolbox 0.10.
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved
43 changes: 20 additions & 23 deletions noxconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,13 @@
MutableMapping,
)

from exasol.toolbox.nox.plugin import hookimpl
from nox import Session


@dataclass(frozen=True)
class Config:
root: Path = Path(__file__).parent
doc: Path = Path(__file__).parent / "doc"
version_file: Path = Path(__file__).parent / "exasol" / "bucketfs" / "version.py"
path_filters: Iterable[str] = (
"dist",
".eggs",
"venv",
)

@staticmethod
def pre_integration_tests_hook(
session: Session, _config: Config, _context: MutableMapping[str, Any]
) -> bool:
"""Implement if project specific behaviour is required"""
class IntegrationTestsPlugin:
@hookimpl
def pre_integration_tests_hook(self, session, config, context):
with TemporaryDirectory() as tmp_dir:
tmp_dir = Path(tmp_dir)
checkout_name = "ITDE"
Expand All @@ -51,15 +39,24 @@ def pre_integration_tests_hook(
"--db-mem-size",
"4GB",
)
return True

@staticmethod
def post_integration_tests_hook(
session: Session, _config: Config, _context: MutableMapping[str, Any]
) -> bool:
"""Implement if project specific behaviour is required"""
@hookimpl
def post_integration_tests_hook(self, session, config, context):
session.run("docker", "kill", "db_container_test", external=True)
return True


@dataclass(frozen=True)
class Config:
root: Path = Path(__file__).parent
doc: Path = Path(__file__).parent / "doc"
version_file: Path = Path(__file__).parent / "exasol" / "bucketfs" / "version.py"
path_filters: Iterable[str] = (
"dist",
".eggs",
"venv",
)

plugins = [IntegrationTestsPlugin]


PROJECT_CONFIG = Config()
Loading
Loading