forked from wmalgadey/PyTado
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.2 KB
/
pre-commit.yml
File metadata and controls
51 lines (42 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: CI
on:
push:
branches-ignore:
- master
pull_request: ~
env:
FORCE_COLOR: 1
jobs:
get-python-version:
runs-on: ubuntu-latest
outputs:
python-version: ${{ steps.python-version.outputs.python_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read .python-version
id: python-version
run: |
python_version=$(cat .python-version)
echo "python_version=$python_version" >> "$GITHUB_OUTPUT"
echo "Python version found: $python_version"
lint:
runs-on: ubuntu-latest
needs: get-python-version
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: '.python-version'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ needs.get-python-version.outputs.python-version }}-pip-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[all]'
- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1