mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-23 00:05:09 +00:00
ci: refactor and merge pre-commit + lint
This commit is contained in:
parent
867716dc33
commit
03dfac329a
1 changed files with 61 additions and 0 deletions
61
.github/workflows/check.yml
vendored
Normal file
61
.github/workflows/check.yml
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
# .github/workflows/check.yml
|
||||||
|
name: Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [main, develop]
|
||||||
|
push:
|
||||||
|
branches: [main, develop]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-commit:
|
||||||
|
name: Pre-commit checks
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install pre-commit
|
||||||
|
run: |
|
||||||
|
pip install pre-commit
|
||||||
|
pre-commit install
|
||||||
|
|
||||||
|
- name: Run pre-commit on all files
|
||||||
|
run: pre-commit run --all-files
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Lint (YAML, Shell, Docker)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install linters
|
||||||
|
run: |
|
||||||
|
pip install yamllint
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y shellcheck
|
||||||
|
curl -sL https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -o hadolint
|
||||||
|
chmod +x hadolint
|
||||||
|
sudo mv hadolint /usr/local/bin/
|
||||||
|
|
||||||
|
- name: Run yamllint
|
||||||
|
run: yamllint .
|
||||||
|
|
||||||
|
- name: Run shellcheck
|
||||||
|
run: |
|
||||||
|
find . -type f -name "*.sh" -exec shellcheck {} +
|
||||||
|
|
||||||
|
- name: Run hadolint
|
||||||
|
run: |
|
||||||
|
find . -type f -name "Dockerfile*" -exec hadolint {} +
|
||||||
Loading…
Reference in a new issue