Skip to content

Migrate to GitHub Actions #36

Migrate to GitHub Actions

Migrate to GitHub Actions #36

Workflow file for this run

name: Unit-tests for Conda install
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
env:
CHANNEL: "nightly"
jobs:
tests:
strategy:
matrix:
python_version: ["3.7", "3.8", "3.9", "3.10"]
fail-fast: false
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: linux.12xlarge
repository: pytorch/captum
script: |
# Set up Environment Variables
export PYTHON_VERSION="${{ matrix.python_version }}"
export VERSION="cpu"
export CUDATOOLKIT="cpuonly"
# Set CHANNEL
if [[ (${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
export CHANNEL=test
else
export CHANNEL=nightly
fi
# Create Conda Env
conda create -yp ci_env python="${PYTHON_VERSION}"
conda activate /pytorch/captum/ci_env
./scripts/install_via_conda.sh -n
# Run Tests
python3 -m pytest -ra --cov=. --cov-report term-missing