update gitignore #572
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Checks | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 1 # do not run jobs in parallel to spare DCOR-dev | |
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: | | |
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 | |
# start xvfb in the background | |
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 & | |
- name: Install Python dependencies | |
run: | | |
# prerequisites | |
python -m pip install --upgrade pip wheel | |
python -m pip install coverage flake8 | |
python -m pip install -r tests/requirements.txt | |
# install dependencies | |
pip install .[GUI] | |
# 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 dcoraid --version | |
- name: Test with pytest | |
# Use bash on Windows, otherwise || exit 0 does not work | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DCOR_API_KEY: ${{ secrets.DCOR_API_KEY }} | |
# Tests always pass but pytest sometimes fails with 138 or 139 due to | |
# threading issues. We check in the next step whether any tests failed. | |
run: | | |
coverage run --source=dcoraid -m pytest tests --ignore tests/test_gui.py -x | |
# The GUI tests segfault randomly (test in next step whether it worked) | |
coverage run --source=dcoraid -m pytest tests/test_gui.py -x || exit 0 | |
- name: Test whether test passed | |
# check if pytest wrote failures to the "pytest-failures.txt" file | |
# (exits 0 if the file does not exist) | |
run: | | |
test ! -f "pytest-failures.txt" | |
- name: Lint with flake8 | |
run: | | |
flake8 --exclude _version.py . | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
- name: Create app and check if it runs (macOS) | |
if: runner.os == 'macOS' | |
working-directory: ./build-recipes | |
run: | | |
bash ./macos_build_app.sh DCOR-Aid $(python -m dcoraid --version) |