2024-08-22 nightly release (1d4ce73c57417f1af8278af56631de3c25e3bbaf) #760
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: Unit-tests on Windows CPU | |
on: | |
pull_request: | |
push: | |
branches: | |
- nightly | |
- main | |
- release/* | |
workflow_dispatch: | |
env: | |
CHANNEL: "nightly" | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
python_version: ["3.8", "3.9", "3.10"] | |
fail-fast: false | |
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main | |
with: | |
runner: windows.4xlarge | |
repository: pytorch/text | |
script: | | |
set -euxo pipefail | |
# Mark Build Directory Safe | |
git config --global --add safe.directory /__w/text/text | |
# Set up Environment Variables | |
export PYTHON_VERSION="${{ matrix.python_version }}" | |
export VERSION="cpu" | |
# 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 -y --name ci_env python="${PYTHON_VERSION}" | |
conda activate ci_env | |
python -m pip --quiet install cmake>=3.18.0 ninja | |
conda env update --file ".circleci/unittest/windows/scripts/environment.yml" --prune | |
# TorchText-specific Setup | |
printf "* Downloading SpaCy English models\n" | |
python -m spacy download en_core_web_sm | |
printf "* Downloading SpaCy German models\n" | |
python -m spacy download de_core_news_sm | |
# Install PyTorch, Torchvision | |
conda install \ | |
--yes \ | |
-c "pytorch-${CHANNEL}" \ | |
pytorch \ | |
cpuonly | |
printf "* Installing pywin32_postinstall script\n" | |
curl --output pywin32_postinstall.py https://raw.githubusercontent.com/mhammond/pywin32/main/pywin32_postinstall.py | |
python pywin32_postinstall.py -install | |
"packaging/vc_env_helper.bat" python setup.py develop | |
python -m pip install parameterized | |
# Run Tests | |
python -m torch.utils.collect_env | |
cd test | |
python -m pytest --cov=torchtext --junitxml=test-results/junit.xml -v --durations 20 torchtext_unittest |