Switch github runner to macos-12 as macos-latest is now arm64 (https:… #169
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: | |
push: | |
branches: [ master, dev ] | |
paths-ignore: | |
- 'docs/**' | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
os: [ubuntu-latest, windows-latest, macos-12] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache conda packages | |
uses: actions/cache@v4 | |
env: | |
# Increase this value to reset cache | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-${{ env.CACHE_NUMBER }} | |
- name: Set up Python ${{ matrix.python-version }} (Miniconda) | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
mamba-version: "*" | |
channel-priority: strict | |
channels: conda-forge | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
- name: Conda info | |
shell: bash -l {0} | |
run: | | |
mamba info | |
mamba list | |
conda config --show-sources | |
conda config --show | |
- name: Install build dependencies | |
shell: bash -l {0} | |
run: | | |
mamba install -q -n base conda-build conda-verify boa | |
mamba install -q anaconda-client libarchive | |
- name: Install build dependencies (Linux) | |
shell: bash -l {0} | |
run: | | |
mamba install -n base libiconv | |
sudo apt install libegl1 libopengl0 | |
if: runner.os == 'Linux' | |
- name: Fetch tags | |
if: ${{ !env.ACT }} | |
run: git fetch --prune --unshallow # This is important to get version git | |
- name: Build | |
shell: bash -l {0} | |
run: | | |
conda mambabuild recipe --python ${{ matrix.python-version }} | |
mamba install qt6molecularnetwork pyside6mn --use-local | |
- name: Install test dependencies | |
shell: bash -l {0} | |
run: mamba install -q tinycss2 pytest toml pytest-qt pytest-cov codecov pytest-mock | |
- name: Install test dependencies (Linux) | |
shell: bash -l {0} | |
run: mamba install pytest-xvfb | |
if: runner.os == 'Linux' | |
- name: Test with pytest | |
shell: bash -l {0} | |
run: cd tests && pytest --cov=PySide6MolecularNetwork --cov-report=xml . | |
- name: Upload coverage | |
if: success() | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
name: ${{ runner.os }} Python ${{ matrix.python-version }} |