name: Test on: push: branches: [ master, develop, 'dev/*' ] pull_request: branches: [ master, develop ] jobs: test: name: test (${{ matrix.os }}, py-${{ matrix.python_version }}) runs-on: ${{ matrix.os }} defaults: run: shell: bash -el {0} strategy: fail-fast: false matrix: os: ['ubuntu-22.04', windows-latest, macOS-latest] python_version: ['3.8'] include: # PsychoPy currently restricted to <= 3.10 - os: ubuntu-22.04 python_version: '3.10' steps: - uses: actions/checkout@v2 - name: Install APT dependencies if: "startsWith(runner.os, 'Linux')" run: | make install-deps-apt - name: Install conda uses: conda-incubator/setup-miniconda@v3 with: environment-file: environments/eeg-expy-full.yml auto-activate-base: false python-version: ${{ matrix.python_version }} activate-environment: eeg-expy-full channels: conda-forge miniconda-version: "latest" - name: Recreate environment with osx-64 platform (macOS only) if: matrix.os == 'macOS-latest' run: | # Remove the osx-arm64 environment conda deactivate conda env remove -n eeg-expy-full --yes # Create osx-64 platform with audio support conda create -v --platform osx-64 -n eeg-expy-full python=${PYTHON_VERSION} conda activate eeg-expy-full conda env update -f environments/eeg-expy-full.yml env: PYTHON_VERSION: ${{ matrix.python_version }} - name: Fix PsychXR numpy dependency DLL issues (Windows only) if: matrix.os == 'windows-latest' run: | conda install --force-reinstall numpy - name: Run eegnb install test run: | if [ "$RUNNER_OS" == "Linux" ]; then Xvfb :0 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &> xvfb.log & export DISPLAY=:0 fi eegnb --help eegnb runexp --help - name: Run examples with coverage run: | if [ "$RUNNER_OS" == "Linux" ]; then Xvfb :0 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &> xvfb.log & export DISPLAY=:0 fi make test PYTEST_ARGS="--ignore=tests/test_run_experiments.py" typecheck: name: typecheck (${{ matrix.os }}, py-${{ matrix.python_version }}) runs-on: ${{ matrix.os }} defaults: run: shell: bash -el {0} strategy: fail-fast: false matrix: os: ['ubuntu-22.04'] python_version: [3.9] steps: - uses: actions/checkout@v2 - name: Install conda uses: conda-incubator/setup-miniconda@v3 with: environment-file: environments/eeg-expy-full.yml auto-activate-base: false python-version: ${{ matrix.python_version }} activate-environment: eeg-expy-full channels: conda-forge miniconda-version: "latest" - name: Typecheck run: | make typecheck