forked from diffCheckOrg/diffCheck
-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (37 loc) · 1.14 KB
/
py-sanity-check.yml
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
37
38
39
40
41
42
name: py-sanity-checks
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.9.1
- name: Cache conda environment cache
uses: actions/cache@v2
with:
path: C:\Miniconda\envs\diff_check
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
restore-keys: |
${{ runner.os }}-conda-
id: cache-conda
- name: Create diff_check conda environment if not cached
if: steps.cache-conda.outputs.cache-hit != 'true'
run: |
conda env create -f environment.yml
- name: Cache pre-commit hooks
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: conda run --name diff_check --no-capture-output pre-commit run --all-files