forked from ZELLMECHANIK-DRESDEN/ShapeOut2
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (78 loc) · 2.74 KB
/
check.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
name: Checks
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
os: [macos-latest, ubuntu-latest, windows-latest]
env:
# Display must be available globally for linux to know where xvfb is
DISPLAY: :0
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
# Stuff copied wildly from several stackoverflow posts
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libxcb-shape0 libglib2.0-0 libgl1-mesa-dev
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: install R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.1.2'
- name: Install R packages for lme4
shell: bash
run: |
R --version
R -e "install.packages(c('statmod','nloptr','lme4'),repos='http://cran.rstudio.org')"
- name: Install Python dependencies
run: |
# prerequisites
python -m pip install --upgrade pip wheel
python -m pip install coverage flake8
# install dependencies
pip install .
pip install -r tests/requirements.txt
# show installed packages
pip freeze
- name: Start application and print version
env:
# Display must be available globally for linux to know where xvfb is
QT_DEBUG_PLUGINS: 1
run: |
python -m shapeout2 --version
- name: Test with pytest
env:
# github token required for testing update.py
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coverage run --source=shapeout2 -m pytest -x tests
- name: Lint with flake8
run: |
flake8 --exclude _version.py .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
# FIXME Limit runtime until
# https://github.com/codecov/codecov-action/issues/1316 is resolved
timeout-minutes: 1
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Create app and check if it runs (macOS)
if: runner.os == 'macOS'
working-directory: ./build-recipes
run: |
bash ./macos_build_app.sh ShapeOut2 $(python -m shapeout2 --version)