forked from felixonmars/fcitx5-pinyin-zhwiki
-
Notifications
You must be signed in to change notification settings - Fork 6
51 lines (40 loc) · 1.38 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Tests
on:
push:
branches: ['master']
pull_request:
branches: ['master']
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install libime
run: sudo apt install -y libime-bin
- name: Install Poetry
run: pipx install poetry
- name: Set up Python 3.12
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.12'
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
poetry env info
poetry show
- name: Lint with yapf
run: poetry run yapf -i -r mw2fcitx
- name: Test with pytest
run: |
poetry run coverage erase
poetry run coverage run -m pytest tests/
poetry run coverage run -a -m mw2fcitx.main -c tests/cli/conf_one.py
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}