[WIP] Test macOS with separate conda install #14
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
# macOS Check | |
# Since macOS isn't currently working with the build in conda build try an isolated conda build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
PYTORCH_MPS_HIGH_WATERMARK_RATIO: 0.0 | |
name: MacOS Check | |
jobs: | |
macOS-check: | |
strategy: | |
fail-fast: false | |
runs-on: macos-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
CRAN_REPO: https://packagemanager.rstudio.com/all/__linux__/focal/latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install DeepForest | |
run: pip install git+https://[email protected]/weecology/deepforest.git | |
- name: Check accelerator support | |
run: | | |
import torch | |
mps_device = torch.device("cpu") | |
x = torch.ones(1) | |
shell: python {0} | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install R dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::rcmdcheck | |
needs: check | |
- name: Install deepforestr | |
run: | | |
install.packages('deepforestr') | |
shell: Rscript {0} | |
- name: Check device | |
run: | | |
library(deepforestr) | |
model = df_model() | |
model$use_release() | |
model$device | |
shell: Rscript {0} | |
- name: Install & check deepforestr | |
uses: r-lib/actions/check-r-package@v2 | |
with: | |
upload-snapshots: true | |
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' | |
### Next thing to try | |
### Add a deepforest_config file to force using the cpu |