ENH: Creates a config.yaml file to hold badger's settings #50
Workflow file for this run
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: Tests | |
on: | |
pull_request: | |
push: | |
schedule: | |
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of the month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
# │ │ │ │ │ | |
- cron: '0 0 * * *' | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
max-parallel: 1 | |
matrix: | |
os: [ubuntu-latest] # TODO: add windows and macos to matrix | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
env: | |
DISPLAY: ':99.0' | |
QT_MAC_WANTS_LAYER: 1 # PyQT gui tests involving qtbot interaction on macOS will fail without this | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Miniforge | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
activate-environment: badger-dev | |
use-mamba: true | |
python-version: ${{ matrix.python-version }} | |
environment-file: env/environment.yml | |
# Have to install pyqt5 with pip | |
- name: Install pyqt5 | |
shell: bash -el {0} | |
run: | | |
pip install PyQt5 | |
- name: Update environment | |
# Mainly need Xopt | |
# TODO: evaluate need for this env file | |
shell: bash -l {0} | |
run: | | |
mamba install -n badger-dev python=${{ matrix.python-version }} | |
- name: Install python packages | |
# Qt related packages after pyqt5 is installed | |
shell: bash -el {0} | |
run: | | |
mamba install --file env/requirements.txt | |
- name: Install libs for testing a pyqt app on linux | |
shell: bash -el {0} | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt install xvfb herbstluftwm libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils | |
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset | |
sleep 3 | |
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_herbstluftwm_99.pid --make-pidfile --background --exec /usr/bin/herbstluftwm | |
sleep 1 | |
fi | |
- name: Install Badger | |
shell: bash -l {0} | |
run: | | |
pip install . | |
- name: Run Tests | |
shell: bash -l {0} | |
run: | | |
python scripts/run_tests.py | |
test-pypi-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install pypa/build | |
run: | | |
python -m pip install build --user | |
- name: Build a source tarball | |
run: | | |
python -m build --sdist --outdir dist/ . |