-
-
Notifications
You must be signed in to change notification settings - Fork 11
95 lines (92 loc) · 2.25 KB
/
python.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Python
on:
push:
paths-ignore:
- '.github/!(workflows)/**'
- 'solutions/typescript/**'
- 'solutions/rust/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '*.json'
- '**/*.js'
- '**/*.cjs'
- '**/*.ts'
- '**/*.md'
pull_request:
paths-ignore:
- '.github/!(workflows)/**'
- 'solutions/typescript/**'
- 'solutions/rust/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '*.json'
- '**/*.js'
- '**/*.cjs'
- '**/*.ts'
- '**/*.md'
defaults:
run:
working-directory: solutions/python
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Cache
id: cache-venv
uses: actions/cache@v3
with:
path: .venv3
key: ${{ runner.os }}-${{ hashFiles('**/Pipfile.lock') }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: pipenv install -d
- name: Lint
run: pipenv run lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Cache
id: cache-venv
uses: actions/cache@v3
with:
path: .venv3
key: ${{ runner.os }}-${{ hashFiles('**/Pipfile.lock') }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: pipenv install -d
- name: Test
run: pipenv run test