-
Notifications
You must be signed in to change notification settings - Fork 5
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
113 additions
and
0 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,41 @@ | ||
name: Setup | ||
|
||
inputs: | ||
python-version: | ||
required: false | ||
default: '3.8' | ||
torch-version: | ||
required: false | ||
default: '2.2.0' | ||
cuda-version: | ||
required: false | ||
default: cpu | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
check-latest: true | ||
cache: pip | ||
cache-dependency-path: | | ||
pyproject.toml | ||
- name: Install PyTorch ${{ inputs.torch-version }}+${{ inputs.cuda-version }} | ||
if: ${{ inputs.torch-version != 'nightly' }} | ||
run: | | ||
pip install torch==${{ inputs.torch-version }} --extra-index-url https://download.pytorch.org/whl/${{ inputs.cuda-version }} | ||
python -c "import torch; print('PyTorch:', torch.__version__)" | ||
python -c "import torch; print('CUDA:', torch.version.cuda)" | ||
shell: bash | ||
|
||
- name: Install PyTorch ${{ inputs.torch-version }}+${{ inputs.cuda-version }} | ||
if: ${{ inputs.torch-version == 'nightly' }} | ||
run: | | ||
pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/${{ inputs.cuda-version }} | ||
python -c "import torch; print('PyTorch:', torch.__version__)" | ||
python -c "import torch; print('CUDA:', torch.version.cuda)" | ||
shell: bash |
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,23 @@ | ||
name: Linting | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
mypy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
pip install -e '.[full,test]' -f https://download.pytorch.org/whl/cpu | ||
- name: Check type hints | ||
run: mypy |
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,49 @@ | ||
name: Testing PyTorch 2.2 | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
|
||
pytest: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 40 | ||
|
||
# Skip workflow if only certain files have been changed. | ||
- name: Get changed files | ||
id: changed-files-specific | ||
uses: tj-actions/changed-files@v41 | ||
with: | ||
files: | | ||
docs/** | ||
examples/** | ||
README.md | ||
CHANGELOG.md | ||
- name: Setup packages | ||
if: steps.changed-files-specific.outputs.only_changed != 'true' | ||
uses: ./.github/actions/setup | ||
|
||
- name: Install main package | ||
if: steps.changed-files-specific.outputs.only_changed != 'true' | ||
run: | | ||
pip install -e .[full,test] | ||
- name: Run tests | ||
if: steps.changed-files-specific.outputs.only_changed != 'true' | ||
run: | | ||
pytest --cov --cov-report=xml | ||
- name: Upload coverage | ||
if: steps.changed-files-specific.outputs.only_changed != 'true' | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
fail_ci_if_error: false |