Skip to content

Bump pypa/gh-action-pypi-publish from 1.14.1 to 1.14.2 in the github-actions group #2

Bump pypa/gh-action-pypi-publish from 1.14.1 to 1.14.2 in the github-actions group

Bump pypa/gh-action-pypi-publish from 1.14.1 to 1.14.2 in the github-actions group #2

Workflow file for this run

name: pre-commit
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
pre-commit:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
name: Pre-commit python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install runtime dependencies
uses: py-actions/py-dependency-install@v4.1.0
- name: Install development dependencies
uses: py-actions/py-dependency-install@v4.1.0
with:
path: "dev-requirements.txt"
- uses: pre-commit/action@v3.0.1
pre-commit_deprecated:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7"]
name: Pre-commit python ${{ matrix.python-version }} (deprecated)
steps:
- uses: actions/setup-python@v7
- name:
run: |
sudo apt-get update
sudo apt-get install \
python3 \
python3-pip \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
curl \
llvm \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
libffi-dev \
liblzma-dev \
python3-openssl
- name: Cache pyenv and pip
id: cache-pyenv
uses: actions/cache@v6
with:
path: |
~/.pyenv
~/.bash_profile
~/.bashrc
~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}
- name: Install pyenv
if: steps.cache-pyenv.outputs.cache-hit != 'true'
run: |
pwd
ls -la
git clone -b v2.6.11 https://github.com/pyenv/pyenv.git ~/.pyenv
cd ~/.pyenv && src/configure && make -C src
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init - bash)"' >> ~/.bash_profile
- name: Install python ${{matrix.python-version}} using pyenv
if: steps.cache-pyenv.outputs.cache-hit != 'true'
run: |
source ~/.bash_profile
pyenv install ${{matrix.python-version}}
pyenv global ${{matrix.python-version}}
- uses: actions/checkout@v7
- name: Install runtime dependencies
run: |
source ~/.bash_profile
python -mvenv .env
source .env/bin/activate
pip install --upgrade pip wheel
pip install -r requirements.txt -r dev-requirements.txt
- name: Pre-commit
run: |
source ~/.bash_profile
source .env/bin/activate
case ${{ matrix.python-version }} in
# 3.6)
# pre_commit_file=.pre-commit-config-3.6.yaml
# ;;
*)
pre_commit_file=.pre-commit-config.yaml
;;
esac
pre-commit run -a -c "$pre_commit_file"