Skip to content

Commit 9c31b7c

Browse files
committed
ADD-WIP: action for py-sanity check
1 parent 4994453 commit 9c31b7c

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Python sanity check (pre-commits)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: windows-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Setup conda environment
13+
uses: conda-incubator/setup-miniconda@v2
14+
with:
15+
auto-update-conda: true
16+
python-version: 3.9.1
17+
- name: Create diff_check conda environment
18+
run: |
19+
conda env create -f environment.yml
20+
- name: Cache conda environment cache
21+
uses: actions/cache@v2
22+
with:
23+
path: C:\Miniconda\envs\diff_check
24+
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
25+
26+
- name: Cache pre-commit hooks
27+
uses: actions/cache@v2
28+
with:
29+
path: ~/.cache/pre-commit
30+
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
31+
- name: Install pre-commit
32+
run: pip install pre-commit
33+
- name: Run pre-commit
34+
run: conda run --name diff_check --no-capture-output pre-commit run --all-files

0 commit comments

Comments
 (0)