|
| 1 | +name: GPU Tests |
| 2 | + |
| 3 | +# Test on all pushes, except when the push is literally just a tag (because we |
| 4 | +# tag automatically via CI, and therefore there's no extra code in that push). |
| 5 | +# Also, only test on pull requests into master/dev. |
| 6 | +on: |
| 7 | + push: |
| 8 | + tags-ignore: |
| 9 | + - 'v*' |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - 'main' |
| 13 | + |
| 14 | +jobs: |
| 15 | + tests: |
| 16 | + env: |
| 17 | + ENV_NAME: tests |
| 18 | + PYTHON: "3.10" |
| 19 | + OS: Ubuntu |
| 20 | + name: Self-Hosted Tests (GPU) |
| 21 | + runs-on: [self-hosted, gpu] |
| 22 | + defaults: |
| 23 | + run: |
| 24 | + # Adding -l {0} ensures conda can be found properly in each step |
| 25 | + shell: bash -l {0} |
| 26 | + steps: |
| 27 | + - name: Add Home to PATH |
| 28 | + run: | |
| 29 | + echo "/home/locoadmin/bin" >> $GITHUB_PATH |
| 30 | + echo "/usr/local/cuda/bin" >> $GITHUB_PATH |
| 31 | + echo "LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV |
| 32 | +
|
| 33 | + - uses: actions/checkout@main |
| 34 | + with: |
| 35 | + fetch-depth: 0 |
| 36 | + |
| 37 | + - name: Cache conda |
| 38 | + uses: actions/cache@v2 |
| 39 | + env: |
| 40 | + # Increase this value to reset cache if ci/test-env.yml has not changed |
| 41 | + CACHE_NUMBER: 0 |
| 42 | + with: |
| 43 | + path: ~/conda_pkgs_dir |
| 44 | + key: |
| 45 | + ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ env.PYTHON }}-${{ hashFiles('ci/test-env.yml', 'setup.cfg') }} |
| 46 | + |
| 47 | + - name: Setup Miniconda |
| 48 | + uses: conda-incubator/setup-miniconda@v2.1.1 |
| 49 | + with: |
| 50 | + # auto-update-conda: true |
| 51 | + miniconda-version: "latest" |
| 52 | + python-version: ${{ env.PYTHON }} |
| 53 | + environment-file: ci/test-env.yml |
| 54 | + activate-environment: tests |
| 55 | + channels: conda-forge,defaults |
| 56 | + channel-priority: strict |
| 57 | + use-only-tar-bz2: true |
| 58 | + |
| 59 | + - name: Conda Info |
| 60 | + run: | |
| 61 | + conda info -a |
| 62 | + conda list |
| 63 | + PYVER=`python -c "import sys; print('{:d}.{:d}'.format(sys.version_info.major, sys.version_info.minor))"` |
| 64 | + if [[ $PYVER != $PYTHON ]]; then |
| 65 | + exit 1; |
| 66 | + fi |
| 67 | +
|
| 68 | + - name: Install |
| 69 | + run: | |
| 70 | + echo $(which pip) |
| 71 | + pip install .[test,gpu] |
| 72 | +
|
| 73 | + - name: Run Tests |
| 74 | + run: | |
| 75 | + python -m pytest --cov=vis_cpu --cov-config=.coveragerc --cov-report xml:./coverage.xml --durations=25 --log-cli-level=DEBUG |
| 76 | +
|
| 77 | + - uses: codecov/codecov-action@v2 |
| 78 | + if: success() |
| 79 | + with: |
| 80 | + fail_ci_if_error: true |
| 81 | + verbose: true |
| 82 | + file: ./coverage.xml |
0 commit comments