-
Notifications
You must be signed in to change notification settings - Fork 11
88 lines (75 loc) · 1.96 KB
/
ci.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
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
name: Run tests
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
inputs:
no-cache:
description: "Run tests without cache"
default: false
required: false
type: boolean
jobs:
run-tests:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.10"
NO_CACHE: ${{ github.event.inputs.no-cache || 'false' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Install dependencies
run: poetry install
- name: Download unidic artifacts
run: |
if [ ! -f "$(poetry env info -p)/lib/python$PYTHON_VERSION/site-packages/unidic/dicdir/version" ]; then
poetry run python -m unidic download
fi
- name: Run tests
run: |
poetry run pytest -v -s ./tests
lint_check:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.10"
steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Install dev dependencies
run: |
poetry install --only dev
- name: Check black and isort and flake8
run: |
poetry run black --check --diff .
poetry run isort --check-only --diff .
poetry run flake8 .
markdown_lint_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: markdownlint-cli
uses: nosborn/[email protected]
with:
files: README.md
config_file: .markdownlint.yaml