-
Notifications
You must be signed in to change notification settings - Fork 25
50 lines (45 loc) · 1.21 KB
/
main.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
43
44
45
46
47
48
49
50
name: Tests
on:
push:
branches:
- '*'
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
jobs:
Safety:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.7
- name: Install Pipenv
uses: dschep/install-pipenv-action@v1
- name: Install Safety
run: pip install safety
- name: Check dependencies
run: pipenv lock --dev --requirements | safety check --stdin
Linting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Python
uses: actions/[email protected]
- name: Hash Python version
id: hash
run: echo ::set-output name=hash::$(python --version | sha256sum | cut -d' ' -f1)
- name: Restore cache
uses: actions/[email protected]
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ steps.hash.outputs.hash }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
uses: pre-commit/[email protected]