mirror of
https://github.com/tubearchivist/tubearchivist-metrics.git
synced 2025-07-02 00:11:09 +00:00
add precommit workflow
This commit is contained in:
parent
b6732971b4
commit
d70874b7ee
37
.github/workflows/pre_commit.yml
vendored
Normal file
37
.github/workflows/pre_commit.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: Lint, Test, Build, and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Cache pre-commit environment
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cache/pre-commit
|
||||
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pre-commit-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install pre-commit
|
||||
pre-commit install
|
||||
|
||||
- name: Run pre-commit
|
||||
run: |
|
||||
pre-commit run --all-files
|
Loading…
x
Reference in New Issue
Block a user