feat: Initial commit #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pre-commit | |
on: | |
push: | |
branches: ["*"] | |
jobs: | |
pre-commit: | |
permissions: read-all | |
runs-on: ubuntu-latest | |
container: | |
image: alpine:3.19 | |
env: | |
APK_CACHE_DIR: ~/.cache/apk | |
steps: | |
- name: Install job dependencies | |
run: apk add tar git | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache | |
key: pre-commit | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Ensure cache directories | |
run: | | |
mkdir -p $APK_CACHE_DIR | |
mkdir -p $GOPATH | |
mkdir -p ~/.cache/pip | |
mkdir -p ~/.cache/pre-commit | |
- name: Install job dependencies | |
run: | | |
apk update --cache-dir $APK_CACHE_DIR | |
apk add --cache-dir $APK_CACHE_DIR python3-dev py3-pip pipx gcc musl-dev | |
pip install pre-commit | |
- name: Run pre-commit-hooks | |
run: | | |
git config --global --add safe.directory $PWD | |
pipx run pre-commit run --all-files --color=always --show-diff-on-failure |