Skip to content

Commit c538580

Browse files
Ananth Subramaniamfacebook-github-bot
authored andcommitted
Update unit test workflow
Summary: Test against newer python versions Reviewed By: tangbinh Differential Revision: D38267458 fbshipit-source-id: 04d984a6376f5c4e31c82e26b6fb6744a79ffb2c
1 parent 3739100 commit c538580

1 file changed

Lines changed: 31 additions & 21 deletions

File tree

.github/workflows/test.yml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
name: Test
1+
name: unit test
2+
23
on:
3-
- push
4-
- pull_request_target
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
58
jobs:
6-
lint:
7-
runs-on: ubuntu-18.04
8-
steps:
9-
- uses: actions/setup-python@v2
10-
- uses: actions/checkout@v2
11-
- run: pip install flake8
12-
- run: flake8
13-
unit-test:
14-
needs: lint
9+
unit_tests:
10+
runs-on: ubuntu-latest
1511
strategy:
1612
matrix:
17-
python:
18-
- 2.7
19-
- 3.5
20-
runs-on: ubuntu-18.04
13+
python-version: [3.7, 3.8, 3.9]
2114
steps:
22-
- uses: actions/setup-python@v2
15+
- name: Check out repo
16+
uses: actions/checkout@v2
17+
- name: Setup conda env
18+
uses: conda-incubator/setup-miniconda@v2
2319
with:
24-
python-version: ${{ matrix.python }}
25-
- uses: actions/checkout@v2
26-
- run: pip install -e .[test]
27-
- run: ./test/run_test.sh
20+
miniconda-version: "latest"
21+
activate-environment: test
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
shell: bash -l {0}
25+
run: |
26+
set -eux
27+
conda activate test
28+
conda install pytorch cpuonly -c pytorch-nightly
29+
pip install -r requirements.txt
30+
- name: Run unit tests with coverage
31+
shell: bash -l {0}
32+
run: |
33+
set -eux
34+
conda activate test
35+
pytest --cov=. --cov-report xml tests -vv
36+
- name: Upload Coverage to Codecov
37+
uses: codecov/codecov-action@v2

0 commit comments

Comments
 (0)