diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3efee33..5fa6320 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,4 @@ -# GitHub Actions configuration **EXAMPLE**, -# MODIFY IT ACCORDING TO YOUR NEEDS! -# Reference: https://docs.github.com/en/actions - -name: tests +name: build on: push: @@ -60,8 +56,7 @@ jobs: strategy: matrix: python: - - "3.9" # oldest Python supported by PSF - - "3.11" # newest Python that is stable + - "3.11" platform: - ubuntu-latest # - macos-latest @@ -94,35 +89,32 @@ jobs: flag-name: ${{ matrix.platform }} - py${{ matrix.python }} parallel: true -# finalize: -# needs: test -# runs-on: ubuntu-latest -# steps: -# - name: Finalize coverage report -# uses: coverallsapp/github-action@master -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} -# parallel-finished: true -# -# publish: -# needs: finalize -# if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} -# runs-on: ubuntu-latest -# permissions: -# contents: write -# steps: -# - uses: actions/checkout@v4 -# - uses: actions/setup-python@v5 -# with: {python-version: "3.11"} -# - name: Retrieve pre-built distribution files -# uses: actions/download-artifact@v4 -# with: {name: python-distribution-files, path: dist/} -# - name: Publish Package -# env: -# # TODO: Set your PYPI_TOKEN as a secret using GitHub UI -# # - https://pypi.org/help/#apitoken -# # - https://docs.github.com/en/actions/security-guides/encrypted-secrets -# TWINE_REPOSITORY: pypi -# TWINE_USERNAME: __token__ -# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} -# run: pipx run tox -e publish + finalize: + needs: test + runs-on: ubuntu-latest + steps: + - name: Finalize coverage report + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true + + publish: + needs: finalize + if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: {python-version: "3.11"} + - name: Retrieve pre-built distribution files + uses: actions/download-artifact@v4 + with: {name: python-distribution-files, path: dist/} + - name: Publish Package + env: + TWINE_REPOSITORY: pypi + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: pipx run tox -e publish diff --git a/README.md b/README.md index 20a956c..72e8028 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,14 @@ --> [![Project generated with PyScaffold](https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold)](https://pyscaffold.org/) +[![Coveralls](https://img.shields.io/coveralls/github/imubit/k8s-job-scheduler/main.svg)](https://coveralls.io/r/imubit/k8s-job-scheduler) +[![PyPI-Server](https://img.shields.io/pypi/v/k8s-job-scheduler.svg)](https://pypi.org/project/k8s-job-scheduler/) + # k8s-job-scheduler -A package for managing Kubernetes jobs and cron jobs from Python. It allows running CLI scripts and Python function within native Kubernetes job engine. +A package for managing Kubernetes jobs and cron jobs from Python. It allows running CLI scripts and Python functions within native Kubernetes job engine. +No need to package separate Docker images with functions to be executed - the package can remotely "inject" the Python function using `dill` into publicly available Docker images. ## Installation diff --git a/tests/test_job_manager.py b/tests/test_job_manager.py index ecd3848..900c144 100644 --- a/tests/test_job_manager.py +++ b/tests/test_job_manager.py @@ -93,7 +93,7 @@ def test_instant_python_job(jobman): assert job_name.startswith("kjs-inst-job-") assert jobman.list_jobs() == [job_name] - time.sleep(10) + time.sleep(15) status, _ = jobman.job_status(job_name) assert status == "SUCCEEDED"