-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Unit-tests for Pip install | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- nightly | ||
- main | ||
- release/* | ||
|
||
workflow_dispatch: | ||
|
||
env: | ||
CHANNEL: "nightly" | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
matrix: | ||
python_version: ["3.6"] | ||
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_pip.sh | ||
# Check formatting with ufmt | ||
ufmt check . | ||
# Lint with flake8 | ||
flake8 | ||
# Run sphinx | ||
sphinx-build -WT --keep-going sphinx/source sphinx/build |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Unit-tests for Pip install | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- nightly | ||
- main | ||
- release/* | ||
|
||
workflow_dispatch: | ||
|
||
env: | ||
CHANNEL: "nightly" | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
matrix: | ||
python_version: ["3.6"] | ||
pytorch_args: ["", "-n", "-v 1.6", "-v 1.7", " -v 1.8", "-v 1.9"] | ||
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_pip.sh ${{ matrix.pytorch_args }} | ||
# Run Tests | ||
python3 -m pytest -ra --cov=. --cov-report term-missing |