-
Notifications
You must be signed in to change notification settings - Fork 55
78 lines (67 loc) · 2.1 KB
/
py.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Python checks
env:
ONEFLOW_SRC: oneflow-src
on:
pull_request:
types: [review_requested]
branches:
- "*"
workflow_dispatch:
inputs:
placeholder:
description: "placeholder, no effect"
required: false
jobs:
check_license_and_format:
name: License and format
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false && contains(github.event.pull_request.requested_reviewers.*.login, 'oneflow-ci-bot')
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install dependencies
# flake8-bugbear flake8-comprehensions are useful but not available internally
run: |
python -m pip install --upgrade pip
python -m pip install flake8==3.8.1 isort==5.10.1
python -m pip install black==21.4b2
flake8 --version
- name: Lint
id: py_check
run: |
isort --check .
black -l 100 --check .
flake8 .
- name: Please request CI again
if: ${{ failure() }}
run: |
exit 1
run_unittest:
name: unit tests
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false && contains(github.event.pull_request.requested_reviewers.*.login, 'oneflow-ci-bot')
steps:
# - uses: actions/checkout@v2
# - name: Set up Python 3.9
# uses: actions/setup-python@v2
# with:
# python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --pre oneflow -f https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cpu
python -m pip install pybind11
python -m pip install torch torchvision torchaudio
- name: Build and install
run: |
python -m pip insatll -e .
- name: Run unittest
run: |
cd dev && bash run_unittest.sh
- name: Please request CI again
if: ${{ failure() }}
run: |
exit 1