forked from NCAR/ADF
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (34 loc) · 1.09 KB
/
ADF_pre-commit.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: pre-commit
on:
pull_request:
types: [opened, synchronize, reopened]
push:
# Run the tests one more time, after the PR changes
# have been pushed. The if-statement below prevents
# the push from running on other repos.
branches:
#Trigger workflow on push to any branch or branch heirarchy:
- '**'
jobs:
#This job is designed to run the "pre-commit"
#set of static analysis, linters, and formatters
#for Python and YAML.
pre-commit:
if: github.event_name == 'pull_request' || github.repository == 'NCAR/ADF'
runs-on: ubuntu-latest
steps:
# acquire github action routines
- uses: actions/checkout@v3
# acquire specific version of python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10' # Use python 3.10
# install pre-commit package
- name: Install pre-commit
run: |
python -m pip install --upgrade pip # Install latest version of PIP
pip install pre-commit
# run pre-commit on ADF code
- name: Run pre-commit
run: pre-commit run -a