112 lines (109 loc) · 3.57 KB
/
build.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
name: Build
on:
pull_request:
push:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install pre-commit
pre-commit install-hooks
- name: Lint with pre-commit
run: |
pre-commit run --all-files
# flake8 pre-commit hook is causing errors
# try again once new version of pyflakes is released (> 2.1.1)
pip install git+https://github.com/PyCQA/pyflakes.git@1911c203a13826d2eb03d582d60874b91e36f4fc --upgrade
pip install flake8==3.7.9
flake8 gaphor
test-linux:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Ubuntu dependencies
run: >
sudo apt-get update -q && sudo apt-get install
--no-install-recommends -y xvfb python3-dev python3-gi
python3-gi-cairo gir1.2-gtk-3.0 libgirepository1.0-dev libcairo2-dev
- name: Install Poetry
uses: dschep/install-poetry-action@v1.2
with:
version: 1.0.0b3
- name: Turn off Virtualenvs
run: poetry config virtualenvs.create false
- name: Install Python Dependencies
run: poetry install
- name: Test with Pytest
run: xvfb-run pytest --cov=gaphor/
- name: Code Climate Coverage Action
uses: paambaati/codeclimate-action@v2.3.0
env:
CC_TEST_REPORTER_ID: 05f6288b94a87daa172d3e96a33ec331a4374be7d01eb9a42b3b21c4c550a8ff
with:
coverageCommand: coverage xml
test-windows:
needs: lint
runs-on: windows-latest
env:
MSYSTEM: MINGW64
MSYS2_ARCH: x86_64
steps:
- uses: actions/checkout@v1
- name: Install MSYS2
run: |
choco install msys2 --params="/NoUpdate /NoPath"
$env:PATH = "C:\tools\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
C:\tools\msys64\usr\bin\pacman --noconfirm -Syyuu
C:\tools\msys64\usr\bin\pacman --noconfirm -Syuu
- name: Install Dependencies
run: |
$env:PATH = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
C:\tools\msys64\usr\bin\bash -lc "win-installer/msys2-install.sh"
env:
CHERE_INVOKING: yes
- name: Run Tests
run: |
$env:PATH = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
C:\tools\msys64\usr\bin\bash -lc "win-installer/msys2-test.sh"
env:
CHERE_INVOKING: yes
PY_IGNORE_IMPORTMISMATCH: yes
test-macos:
needs: lint
runs-on: macOS-latest
env:
PKG_CONFIG_PATH: /usr/local/Cellar/libffi/3.2.1/lib/pkgconfig:${PKG_CONFIG_PATH:-}
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install macOS Dependencies
run: brew install gobject-introspection gtk+3 adwaita-icon-theme
- name: Install Poetry
uses: dschep/install-poetry-action@v1.2
with:
version: 1.0.0b3
- name: Turn off Virtualenvs
run: poetry config virtualenvs.create false
- name: Install Python Dependencies
run: |
poetry install
pip install pytest-xvfb
- name: Test with Pytest
run: pytest