Major refresh #1
Workflow file for this run
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: Run unit tests | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
# <workflow_name>-<branch_name>-<true || commit_sha (if branch is protected)> | |
group: unit-tests-${{ github.ref_name }}-${{ !(github.ref_protected) || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
max-parallel: 10 | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10", ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get year & week number | |
id: get-date | |
run: | | |
echo "date=$(/bin/date "+%Y-%U")" >> $GITHUB_OUTPUT | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
pip install -U pip || python -m pip install -U pip | |
echo "pip_cache=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.pip-cache.outputs.pip_cache }} | |
key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }} | |
restore-keys: | | |
${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}- | |
- name: Install package | |
run: | | |
python setup.py install | |
pip install pytest | |
- name: Run Tests | |
run: | | |
pytest -vvv tests |