Add build workflow
Signed-off-by: Dan Yeaw <dan@yeaw.me>
This commit is contained in:
parent
9697343b5b
commit
0ab6bd896c
96
.github/workflows/build.yml
vendored
Normal file
96
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
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.7
|
||||
- name: Install Ubuntu dependencies
|
||||
run: >
|
||||
sudo apt-get update -q && sudo apt-get install --no-install-recommends -y
|
||||
python3-dev python3-gi python3-gi-cairo gir1.2-gtk-3.0 libgirepository1.0-dev libcairo2-dev
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
source venv
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
source venv
|
||||
xvfb-run coverage run -m pytest
|
||||
test-windows:
|
||||
needs: lint
|
||||
runs-on: [windows]
|
||||
env:
|
||||
MSYS2_ARCH: x86_64
|
||||
MSYSTEM: MINGW64
|
||||
CHERE_INVOKING: yes
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: numworks/setup-msys2@v1
|
||||
- name: Install MSYS2
|
||||
run: |
|
||||
choco install msys2 --params="/InstallDir:%CD:~0,2%\msys64 /NoUpdate /NoPath"
|
||||
set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
|
||||
%CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu
|
||||
%CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syuu
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
|
||||
%CD:~0,2%\msys64\usr\bin\bash -lc ".azure/msys2-install.sh"
|
||||
- name: Run Tests
|
||||
run: |
|
||||
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
|
||||
%CD:~0,2%\msys64\usr\bin\bash -lc ".azure/msys2-test.sh"
|
||||
env:
|
||||
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 dependencies
|
||||
run: |
|
||||
brew install gobject-introspection gtk+3 adwaita-icon-theme
|
||||
source venv
|
||||
pip install pytest-xvfb
|
||||
- name: Run Tests
|
||||
run: |
|
||||
source venv
|
||||
pytest
|
Loading…
Reference in New Issue
Block a user