-
Notifications
You must be signed in to change notification settings - Fork 49
77 lines (64 loc) · 2.08 KB
/
CI.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: CI
on:
schedule:
- cron: 0 9 * * *
# Manually triggerable in github
workflow_dispatch:
push:
paths-ignore:
- "docs/**"
- "*.md"
- ".github/workflows/mirror.yml"
- ".gitlab/.gitlab-ci.yml"
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
- ".github/workflows/mirror.yml"
- ".gitlab/.gitlab-ci.yml"
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: pre-commit/action@v2.0.3
tests:
needs: pre-commit
runs-on: ${{matrix.os}}
if: |
( github.event_name == 'pull_request' ) && ( needs.pre-commit.result == 'success' )
||
( github.event_name == 'schedule' ) && ( needs.pre-commit.result == 'success' )
||
( github.event_name == 'workflow_dispatch' ) && ( needs.pre-commit.result == 'success' )
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest] # FIX: 'ubuntu-latest'(ubunut-22.04) -> 'ubuntu-20.04': Python version 3.6 was not found in the local cache
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.1.7
- name: install deps for MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew install libomp cairo pango gdk-pixbuf libffi
- name: install deps for Ubuntu
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: sudo apt-get install build-essential libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info
- name: install tox
run: |
python3 -m pip install --upgrade pip
pip3 install tox==3.28.0
pip3 install tox-gh-actions==2.12.0
- name: test with tox
run: |
tox