Skip to content

Commit

Permalink
upgrade GitHub actions (#160)
Browse files Browse the repository at this point in the history
* upgrade GitHub actions

* fix docformatter
  • Loading branch information
ArneBinder authored Nov 1, 2024
1 parent b665cb0 commit 06e3af5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/code-quality-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ 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"

#----------------------------------------------
# ----- 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
Expand All @@ -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') }}
Expand All @@ -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
10 changes: 5 additions & 5 deletions .github/workflows/code-quality-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ 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"

#----------------------------------------------
# ----- 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
Expand All @@ -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') }}
Expand All @@ -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}}
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -39,7 +39,7 @@ jobs:
- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/[email protected].1
uses: salsify/[email protected].3
with:
version-command: |
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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') }}
Expand All @@ -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 }}
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 06e3af5

Please sign in to comment.