diff --git a/.github/workflows/create-public-files.yaml b/.github/workflows/create-public-files.yaml index 3abd0c0..112abbb 100644 --- a/.github/workflows/create-public-files.yaml +++ b/.github/workflows/create-public-files.yaml @@ -77,7 +77,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Setup Python + uses: actions/setup-python@v5 with: python-version: '3.12' cache: 'pip' diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000..d1e8ba7 --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,32 @@ +on: + pull_request: + push: + branches: [main, master] + +name: pre-commit + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install pre-commit + shell: bash + run: pip install pre-commit + + - name: Cache pre-commit environment + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + + - name: Run pre-commit + shell: bash + run: pre-commit run --show-diff-on-failure --color=always --all-files diff --git a/.github/workflows/update-data-site.yaml b/.github/workflows/update-data-site.yaml index dba291f..2985e03 100644 --- a/.github/workflows/update-data-site.yaml +++ b/.github/workflows/update-data-site.yaml @@ -23,7 +23,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Setup Python + uses: actions/setup-python@v5 with: python-version: '3.12' cache: 'pip' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..7a08af3 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.7.1 + hooks: + - id: ruff + - id: ruff-format + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.29.0 + hooks: + - id: yamllint