Skip to content

Commit

Permalink
update deprecated and out-of-date github action versions, update pre-…
Browse files Browse the repository at this point in the history
…commit hook versions
  • Loading branch information
speediedan committed Nov 23, 2024
1 parent 82a69e3 commit d9036b6
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
mapDockerSocket: false
volumes:
- /var/run/user/998/docker.sock:/var/run/docker.sock
options: --gpus all
options: --gpus all --shm-size=512m

workspace:
clean: outputs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pkg
run: |
Expand Down
33 changes: 12 additions & 21 deletions .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ jobs:
RUSTFLAGS: ${{ matrix.os == 'macOS-14' && '-A invalid_reference_casting' || '' }}
# TODO: Remove this and enable running MPS tests the macos runners support it:
# https://github.com/actions/runner-images/issues/9918#issuecomment-2149336099
DISABLE_MPS: ${{ matrix.os == 'macOS-14' && '1' || '0' }}
DISABLE_MPS: ${{ (matrix.os == 'macOS-14' && '1') || '0' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -83,40 +83,29 @@ jobs:
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name: Get pip cache dir
# sadly, this env var is not properly abstracted over OS platforms so we set it twice, the second time for windows
- name: Get pip cache dir windows
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
run: |
echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_OUTPUT
echo "PIP_CACHE_DIR=$(pip cache dir)" >> $env:GITHUB_OUTPUT
- name: pip cache
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
path: ${{ steps.pip-cache.outputs.PIP_CACHE_DIR }}
key: ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-${{ hashFiles('requirements/base.txt') }}-${{ hashFiles('requirements/extra.txt') }}
restore-keys: |
${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-
- name: Install extra dependencies
# env: # workaround for macos tokenizers https://github.com/neonbjb/tortoise-tts/issues/728#issuecomment-1962438240
# RUSTFLAGS: '-A invalid_reference_casting'
run: |
pip install --requirement requirements/base.txt --upgrade
pip install --requirement requirements/examples.txt --upgrade
pip install --requirement requirements/test.txt --upgrade
pip list
shell: bash

# - name: Install dependencies
# run: |
# flag=$(python -c "print('--pre' if '${{matrix.release}}' == 'pre' else '')" 2>&1)
# url=$(python -c "print('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html')" 2>&1)
# pip install --requirement requirements.txt --upgrade $flag --find-links "https://download.pytorch.org/whl/${url}"
# # adjust versions according installed Torch version
# python ./requirements/adjust-versions.py requirements/examples.txt
# pip install --requirement requirements/examples.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade
# pip install --requirement requirements/test.txt --upgrade
# pip list
# shell: bash

- name: Cache datasets
uses: actions/cache@v4
with:
Expand All @@ -133,7 +122,7 @@ jobs:
# python -m pytest fts_examples/stable -v --durations=3

- name: Upload pytest results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-${{ matrix.release }}
path: junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-${{ matrix.release }}.xml
Expand All @@ -146,6 +135,8 @@ jobs:
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: coverage.xml
flags: cpu,pytest,python${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
mypy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
pl_version: ["2.4"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v1
Expand All @@ -46,7 +46,7 @@ jobs:

- name: Get release version
id: get_version
run: echo "::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/v})"
run: echo "::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/v})" >> $GITHUB_OUTPUT

- name: Publish Latest to Docker
uses: docker/build-push-action@v2
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
build-package:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'

Expand All @@ -39,7 +39,7 @@ jobs:
python -m build
ls -lh dist/
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: pypi-packages-${{ github.sha }}
path: dist
Expand All @@ -50,7 +50,7 @@ jobs:
# only upload package assets with new release
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: pypi-packages-${{ github.sha }}
Expand All @@ -71,7 +71,7 @@ jobs:
# only publish packages with new tags or release
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: pypi-packages-${{ github.sha }}
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
# only publish packages with new tags or release
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: pypi-packages-${{ github.sha }}
Expand Down
15 changes: 8 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -39,33 +39,34 @@ repos:
- id: detect-private-key

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py37-plus]
name: Upgrade code

# update rev for docformatter after 1.7.6 available, using below commit on master branch until then
- repo: https://github.com/myint/docformatter
rev: v1.4
rev: 06907d0267368b49b9180eed423fae5697c1e909
hooks:
- id: docformatter
args: [--in-place, --wrap-summaries=115, --wrap-descriptions=120]

- repo: https://github.com/asottile/yesqa
rev: v1.4.0
rev: v1.5.0
hooks:
- id: yesqa
name: Unused noqa

- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
rev: 1.19.0
hooks:
- id: blacken-docs
args: [--line-length=120]
additional_dependencies: [black==22.12]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
Expand All @@ -75,7 +76,7 @@ repos:
exclude: CHANGELOG.md

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.15'
rev: 'v0.6.9'
hooks:
- id: ruff
# Respect `exclude` and `extend-exclude` settings.
Expand Down

0 comments on commit d9036b6

Please sign in to comment.