Skip to content

Commit 2e6159c

Browse files
authored
Merge pull request #17 from sp35/sp35-patch-1
Add CI testing for genicons.py
2 parents 3fe3ae2 + bc5ac80 commit 2e6159c

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

.github/workflows/genicons.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: genicons_ci
2+
3+
on:
4+
push:
5+
# Only run if,
6+
paths:
7+
# Changes in python, yaml(github actions)
8+
- "**.py"
9+
- "**.yaml"
10+
pull_request:
11+
# Only run if,
12+
paths:
13+
# Changes in python, yaml(github actions)
14+
- "**.py"
15+
- "**.yaml"
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v1
23+
- name: Set up Python 3
24+
uses: actions/setup-python@v1
25+
with:
26+
python-version: 3.7
27+
- name: Install pip
28+
run: |
29+
python -m pip install --upgrade pip
30+
- name: Testing with flake8
31+
run: |
32+
pip install flake8
33+
flake8 ./scripts/genicons.py
34+
- name: Testing with black
35+
run: |
36+
pip install black
37+
black --check -l 79 ./scripts/genicons.py
38+
test:
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- uses: actions/checkout@v1
43+
- name: Install dependencies
44+
run: |
45+
sudo apt-get install gir1.2-pango-1.0 python3-gi-cairo
46+
- name: Install CC Fonts
47+
run: |
48+
sudo mkdir -p ~/.fonts
49+
sudo ln -sf ${PWD}/www/cc-icons.ttf ~/.fonts/
50+
- name: Run genicons.py
51+
run: python3 scripts/genicons.py
52+

scripts/genicons.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
import math
88
import os
99
import os.path
10+
from functools import reduce
1011

1112
# Third-party
1213
import cairo
1314
import gi
1415

15-
gi.require_version("PangoCairo", "1.0")
16+
gi.require_version("PangoCairo", "1.0") # noqa: E402
1617
from gi.repository import PangoCairo as pangocairo
17-
from functools import reduce
1818

1919

2020
SUITES = {

0 commit comments

Comments
 (0)