44 lines
923 B
YAML
44 lines
923 B
YAML
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: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- 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: |
|
|
python -m pip install --upgrade pip
|
|
npm install @eslint/js
|
|
pip install pre-commit
|
|
|
|
- name: Run pre-commit
|
|
run: |
|
|
pre-commit run --all-files
|