Try change workflow to use micromamba to avoid Python issues on osx #5
This file contains hidden or 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
# This is a basic workflow to help you get started with Actions | |
name: Test-master | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
unittest: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-13] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Set up Micromamba for Python ${{ matrix.python-version }} | |
uses: mamba-org/setup-micromamba@v1 | |
- name: Checkout master branch | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
micromamba create -y -n myenv -c conda-forge python=${{ matrix.python-version }} pip pytest-timeout pytest-xvfb | |
- name: Install open3d on MacOS | |
if: runner.os == 'MacOS' | |
run: micromamba install -y -n myenv -c conda-forge open3d | |
- name: Install wcwidth on Linux | |
if: runner.os == 'Linux' | |
run: micromamba install -y -n myenv -c conda-forge wcwidth | |
- name: Install package and data package | |
run: | | |
micromamba run -n myenv pip install .[dev] | |
# install the data package | |
cd mvtb-data | |
micromamba run -n myenv python -m pip install . | |
- name: Test with pytest | |
env: | |
MPLBACKEND: TkAgg | |
run: | | |
micromamba run -n myenv pytest --ignore=machinevisiontoolbox/blocks --timeout=50 --timeout_method thread -s | |
codecov: | |
# If all tests pass: | |
# Run coverage and upload to codecov | |
needs: unittest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Micromamba for Python 3.11 | |
uses: mamba-org/setup-micromamba@v1 | |
- name: Install dependencies | |
run: | | |
micromamba create -y -n myenv -c conda-forge python=3.11 pip coverage | |
micromamba run -n myenv pip install .[dev] | |
# install the data package | |
cd mvtb-data | |
micromamba run -n myenv python -m pip install . | |
- name: Run coverage | |
run: | | |
micromamba run -n myenv coverage run --source=machinevisiontoolbox -m pytest --ignore=machinevisiontoolbox/blocks | |
micromamba run -n myenv coverage report | |
micromamba run -n myenv coverage xml | |
- name: upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml |