-
Notifications
You must be signed in to change notification settings - Fork 74
151 lines (118 loc) · 3.46 KB
/
checks.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Run checks
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: install nox
run: |
python -m pip install nox
- name: lint
run: |
python -m nox -s lint
test:
runs-on: ubuntu-latest
if: github.event_name == 'push'
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: install nox
run: |
python -m pip install nox
- name: Run tests
env:
GENSHIN_COOKIES: ${{ secrets.GENSHIN_COOKIES }}
HONKAI_COOKIES: ${{ secrets.HONKAI_COOKIES }}
LOCAL_GENSHIN_COOKIES: ${{ matrix.python-version == '3.10' && secrets.LOCAL_GENSHIN_COOKIES || '' }}
run: |
python -m nox -s test --verbose -- --cov-append
mv .coverage .coverage.${{ matrix.python-version }}
# - name: Upload coverage
# uses: actions/upload-artifact@v3
# with:
# name: coverage
# path: .coverage.${{ matrix.python-version }}
# retention-days: 1
# if-no-files-found: error
upload-coverage:
needs: [test]
runs-on: ubuntu-latest
if: false # Temporarily disabled
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Download coverage
uses: actions/download-artifact@v3
with:
name: coverage
- name: Combine coverage
run: |
pip install -r ./genshin-dev/pytest-requirements.txt
coverage combine
coverage xml -i
- name: Upload coverage to codeclimate
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: cd8c7d84ae5f98d86882d666dce0946fe5aae1e63f442995bd9c6e17869e6513
with:
coverageLocations: .coverage.xml:coverage.py
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: install nox
run: |
python -m pip install nox
- name: Run type checker
run: |
python -m nox -s type-check
verify-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: install nox
run: |
python -m pip install nox
- name: Run type checker
run: |
python -m nox -s verify-types
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run prettier
run: |
npx prettier --check *.md docs/*.md *.yml