-
Notifications
You must be signed in to change notification settings - Fork 25
44 lines (41 loc) · 1.08 KB
/
torch.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
name: torch
on:
workflow_dispatch:
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches: [main]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
torch-version: ["~=1.11.0", "~=1.12.0", "~=1.13.0"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and upgrade python packages
run: |
python -m pip install --upgrade pip tox
- name: Set Torch Version
run: |
echo "torch${{ matrix.torch-version }}" > requirements/torch.txt
- name: Run Tests
run: |
ref_type=${{ github.ref_type }}
branch=main
if [[ $ref_type == "tag"* ]]
then
raw=$(git branch -r --contains ${{ github.ref_name }})
branch=${raw/origin\/}
fi
tox -e test-torch -- $branch