forked from VOICEVOX/voicevox_engine
-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (64 loc) · 2.24 KB
/
test.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
name: test
on:
push:
pull_request:
branches:
- "**"
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
python: ["3.11.3"]
steps:
- name: <Setup> Check out the repository
uses: actions/checkout@v4
- name: <Setup> Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
- name: <Setup> Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements-test.txt
- name: <Test> Validate poetry.lock
run: |
poetry lock --no-update
git diff --exit-code
- name: <Test> Check dependency lists
run: |
poetry export --without-hashes -o requirements.txt.check
poetry export --without-hashes --with dev -o requirements-dev.txt.check
poetry export --without-hashes --with test -o requirements-test.txt.check
poetry export --without-hashes --with license -o requirements-license.txt.check
diff -q requirements.txt requirements.txt.check || \
diff -q requirements-dev.txt requirements-dev.txt.check || \
diff -q requirements-test.txt requirements-test.txt.check || \
diff -q requirements-license.txt requirements-license.txt.check > /dev/null
if [ $? = 1 ]; then
echo "poetry export has some diff"
exit 1
fi
- name: <Test> Check format
run: pysen run lint
- name: <Test> Test codes and coverage
run: coverage run --omit=test/* -m pytest
- name: <Deploy> Submit coverage results to Coveralls
if: matrix.os == 'ubuntu-20.04'
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check licenses
shell: bash
run: |
OUTPUT_LICENSE_JSON_PATH=/dev/null \
bash build_util/create_venv_and_generate_licenses.bash
- name: Test names by checking typo
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
uses: crate-ci/[email protected]