Use -platfrom offscreen to prevent Qt errors #139
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
--- | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
name: Tests | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
workflow_dispatch: | |
env: | |
# https://github.com/musescore/MuseScore/issues/17247 | |
# https://github.com/musescore/MuseScore/issues/17247#issuecomment-1510434918 | |
# https://ourcodeworld.com/articles/read/1409/how-to-use-musescore-3-in-headless-mode-in-ubuntu-2004 | |
QT_QPA_PLATFORM: offscreen | |
jobs: | |
tests: | |
name: Python ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- name: >- | |
Install “libfuse2” to prevent AppImage Error: error | |
while loading shared libraries: libfuse.so.2: cannot open shared | |
object file: No such file or directory | |
run: sudo apt install libfuse2 | |
- name: Download latest “mscore” AppImage | |
run: | | |
wget --quiet --output-document mscore https://github.com/musescore/MuseScore/releases/download/v4.2.0/MuseScore-4.2.0.233521125-x86_64.AppImage | |
chmod a+x mscore | |
sudo cp mscore /usr/bin/mscore | |
# https://github.com/marketplace/actions/checkout | |
- uses: actions/checkout@v3 | |
# https://github.com/marketplace/actions/setup-python | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel virtualenv tox tox-gh-actions | |
# https://github.com/ymyzk/tox-gh-actions | |
- name: Run tox targets for ${{ matrix.python-version }} | |
run: python -m tox |