From 06e3af589e424a9c9c09ac9c48223ede31971849 Mon Sep 17 00:00:00 2001 From: ArneBinder Date: Fri, 1 Nov 2024 17:31:36 +0100 Subject: [PATCH] upgrade GitHub actions (#160) * upgrade GitHub actions * fix docformatter --- .github/workflows/code-quality-main.yaml | 10 +++++----- .github/workflows/code-quality-pr.yaml | 10 +++++----- .github/workflows/labeler.yml | 2 +- .github/workflows/release.yml | 12 ++++++------ .github/workflows/test.yaml | 9 +++++---- .pre-commit-config.yaml | 4 +++- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/code-quality-main.yaml b/.github/workflows/code-quality-main.yaml index c766665d..f2b6b747 100644 --- a/.github/workflows/code-quality-main.yaml +++ b/.github/workflows/code-quality-main.yaml @@ -16,10 +16,10 @@ jobs: # check-out repo and set-up python #---------------------------------------------- - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4.2.1 - name: Set up Python 3.9 id: setup-python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5.2.0 with: python-version: "3.9" @@ -27,7 +27,7 @@ jobs: # ----- install & configure poetry ----- #---------------------------------------------- - name: Install Poetry - uses: snok/install-poetry@v1 + uses: snok/install-poetry@v1.4.1 with: virtualenvs-create: true virtualenvs-in-project: true @@ -38,7 +38,7 @@ jobs: #---------------------------------------------- - name: Load cached venv id: cached-poetry-dependencies - uses: actions/cache@v3 + uses: actions/cache@v4.1.0 with: path: .venv key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} @@ -51,4 +51,4 @@ jobs: run: poetry install --no-interaction --no-root - name: Run pre-commits - uses: pre-commit/action@v2.0.3 + uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/code-quality-pr.yaml b/.github/workflows/code-quality-pr.yaml index e0e31bcf..1837b32a 100644 --- a/.github/workflows/code-quality-pr.yaml +++ b/.github/workflows/code-quality-pr.yaml @@ -19,10 +19,10 @@ jobs: # check-out repo and set-up python #---------------------------------------------- - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4.2.1 - name: Set up Python 3.9 id: setup-python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5.2.0 with: python-version: "3.9" @@ -30,7 +30,7 @@ jobs: # ----- install & configure poetry ----- #---------------------------------------------- - name: Install Poetry - uses: snok/install-poetry@v1 + uses: snok/install-poetry@v1.4.1 with: virtualenvs-create: true virtualenvs-in-project: true @@ -41,7 +41,7 @@ jobs: #---------------------------------------------- - name: Load cached venv id: cached-poetry-dependencies - uses: actions/cache@v3 + uses: actions/cache@v4.1.0 with: path: .venv key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} @@ -68,6 +68,6 @@ jobs: # run pre-commit on modified files #---------------------------------------------- - name: Run pre-commits - uses: pre-commit/action@v2.0.3 + uses: pre-commit/action@v3.0.1 with: extra_args: --files ${{ steps.file_changes.outputs.files}} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index b4316826..216b4868 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4.2.1 - name: Run Labeler uses: crazy-max/ghaction-github-labeler@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 08eaf2b4..2e0bf8a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repository - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v4.2.1 with: fetch-depth: 2 - name: Set up Python - uses: actions/setup-python@v2.3.2 + uses: actions/setup-python@v5.2.0 with: python-version: "3.9" @@ -39,7 +39,7 @@ jobs: - name: Detect and tag new version id: check-version if: steps.check-parent-commit.outputs.sha - uses: salsify/action-detect-and-tag-new-version@v2.0.1 + uses: salsify/action-detect-and-tag-new-version@v2.0.3 with: version-command: | bash -o pipefail -c "poetry version | awk '{ print \$2 }'" @@ -58,14 +58,14 @@ jobs: #---------------------------------------------- - name: Publish package on PyPI if: steps.check-version.outputs.tag - uses: pypa/gh-action-pypi-publish@v1.5.0 + uses: pypa/gh-action-pypi-publish@v1.10.3 with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} - name: Publish package on TestPyPI if: "! steps.check-version.outputs.tag" - uses: pypa/gh-action-pypi-publish@v1.5.0 + uses: pypa/gh-action-pypi-publish@v1.10.3 with: user: __token__ password: ${{ secrets.TEST_PYPI_TOKEN }} @@ -75,7 +75,7 @@ jobs: # ----- create github release notes ----- #---------------------------------------------- - name: Publish the release notes - uses: release-drafter/release-drafter@v5.18.1 + uses: release-drafter/release-drafter@v6.0.0 with: publish: ${{ steps.check-version.outputs.tag != '' }} tag: ${{ steps.check-version.outputs.tag }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6e55766b..750cd41e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -36,10 +36,10 @@ jobs: # check-out repo and set-up python #---------------------------------------------- - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4.2.1 - name: Set up python id: setup-python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5.2.0 with: python-version: ${{ matrix.python-version }} @@ -58,7 +58,7 @@ jobs: #---------------------------------------------- - name: Load cached venv id: cached-poetry-dependencies - uses: actions/cache@v3 + uses: actions/cache@v4.1.0 with: path: .venv key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} @@ -84,8 +84,9 @@ jobs: source .venv/bin/activate pytest --ignore=tests/dataset_builders -k "not slow" --cov=src --cov-report term-missing --cov-report xml:coverage.xml - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./coverage.xml + fail_ci_if_error: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01ac619e..9eba8705 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,9 @@ repos: # python docstring formatting - repo: https://github.com/myint/docformatter - rev: v1.7.5 + # rev: v1.7.6 + # as long as https://github.com/PyCQA/docformatter/pull/287 is not yet released + rev: 06907d0 hooks: - id: docformatter args: [--in-place, --wrap-summaries=99, --wrap-descriptions=99]