18
18
steps :
19
19
- name : Checkout repository
20
20
uses : actions/checkout@v2
21
- - name : Set Channel
22
- if : ${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }}
23
- run : |
24
- echo "CHANNEL=test" >> "$GITHUB_ENV"
25
21
tests :
26
22
strategy :
27
23
matrix :
@@ -31,23 +27,27 @@ jobs:
31
27
with :
32
28
runner : linux.12xlarge
33
29
script : |
30
+ # Mark Build Directory Safe
31
+ git config --global --add safe.directory /__w/vision/vision
32
+
33
+ # Set up Environment Variables
34
34
export ENV_NAME=conda-env-"${{ github.run_id }}"
35
35
export PYTHON_VERSION="${{ matrix.py_vers }}"
36
36
export VERSION="cpu"
37
37
export CUDATOOLKIT="cpuonly"
38
+
39
+ # Set CHANNEL
38
40
if [[${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} ]]; then
39
41
export CHANNEL=test
40
42
else
41
43
export CHANNEL=nightly
42
44
fi
43
45
44
- git config --global --add safe.directory /__w/vision/vision
45
- # . ~/miniconda3/etc/profile.d/conda.sh
46
+ # Create Conda Env
46
47
conda create -yp "${ENV_NAME}" python="${PYTHON_VERSION}" numpy libpng jpeg scipy
47
- # echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV"
48
48
export CONDA_RUN="conda run -p ${ENV_NAME}"
49
49
50
- # export PATH=~/miniconda3/bin:$PATH
50
+ # Install PyTorch, Torchvision, and testing libraries
51
51
set -ex
52
52
${CONDA_RUN} conda install \
53
53
--yes \
57
57
${CONDA_RUN} python3 setup.py develop
58
58
${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10'
59
59
60
+ # Run Tests
60
61
${CONDA_RUN} python3 -m torch.utils.collect_env
61
62
${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20
62
-
63
- # steps:
64
- # - name: Checkout repository
65
- # uses: actions/checkout@v2
66
- # - name: Set Release CHANNEL (for release)
67
- # if: ${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }}
68
- # run: |
69
- # echo "CHANNEL=test" >> "$GITHUB_ENV"
70
- # - name: Setup Conda
71
- # shell: bash -l {0}
72
- # env:
73
- # ENV_NAME: conda-env-${{ github.run_id }}
74
- # PY_VERS: ${{ matrix.py_vers }}
75
- # run: |
76
- # git config --global --add safe.directory /__w/vision/vision
77
- # . ~/miniconda3/etc/profile.d/conda.sh
78
- # conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng jpeg scipy
79
- # echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV"
80
- # - name: Install TorchVision
81
- # shell: bash -l {0}
82
- # env:
83
- # VERSION: cpu
84
- # CUDATOOLKIT: cpuonly
85
- # run: |
86
- # # Needed for JPEG library detection as setup.py detects conda presence
87
- # # by running `shutil.which('conda')`
88
- # export PATH=~/miniconda3/bin:$PATH
89
- # set -ex
90
- # ${CONDA_RUN} conda install \
91
- # --yes \
92
- # -c "pytorch-${CHANNEL}" \
93
- # -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \
94
- # "${CUDATOOLKIT}"
95
- # ${CONDA_RUN} python3 setup.py develop
96
- # ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10'
97
- # - name: Run tests
98
- # shell: bash -l {0}
99
- # env:
100
- # ENV_NAME: conda-env-${{ github.run_id }}
101
- # PY_VERS: ${{ matrix.py_vers }}
102
- # run: |
103
- # . ~/miniconda3/etc/profile.d/conda.sh
104
- # set -ex
105
- # ${CONDA_RUN} python3 -m torch.utils.collect_env
106
- # ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20
107
- # conda env remove -p ${ENV_NAME}
0 commit comments