-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (52 loc) · 1.7 KB
/
style.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
# This workflow will check flake style
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Style
on: [push, pull_request]
jobs:
style:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install .
python -c 'import smartcross'
- name: Code style
run: |
python -m pip install .[style]
bash format.sh ./smartcross --test
flake8 ./smartcross
- name: Download cloc
run: |
sudo apt-get update -y
sudo apt-get install -y cloc
- name: Get the Numbers
run: |
cloc .
echo "CODE_LINES=$(./cloc.sh --loc)" >> $GITHUB_ENV
echo "COMMENT_LINES=$(./cloc.sh --percentage)%" >> $GITHUB_ENV
- name: Create Lines-of-Code-Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ secrets.BADGE_GIST_ID }}
filename: loc.json
label: Lines of Code
message: ${{ env.CODE_LINES }}
color: lightgrey
- name: Create Comments-Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ secrets.BADGE_GIST_ID }}
filename: comments.json
label: Comments
message: ${{ env.COMMENT_LINES }}
color: green