-
Notifications
You must be signed in to change notification settings - Fork 1.2k
79 lines (79 loc) · 3.19 KB
/
unittest.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
79
name: Unit Test
on:
push:
branches:
- master
pull_request:
jobs:
unittests:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Log
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
auto-update-conda: true
python-version: 3.7
- name: sanity-check
shell: bash -l {0}
run: |
conda env create -n gluon_cv_lint -f ./tests/pylint.yml
conda env update -n gluon-cv-lint -f ./tests/pylint.yml --prune
conda activate gluon-cv-lint
conda list
make clean
make pylint
- name: unit-test
shell: bash -l {0}
run: |
conda env create -n gluon_cv_py3_test -f tests/py3_mxnet_ci.yml
conda activate gluon_cv_py3_test
pip install --upgrade pip setuptools wheel
pip install --upgrade -e .
export TINY_COCO=~/.mxnet/datasets/tiny_coco
export TINY_MOTORBIKE=~/.mxnet/datasets/tiny_motorbike
mkdir -p $TINY_COCO/annotations
curl -s https://gluoncv-ci.s3-us-west-2.amazonaws.com/mini_coco/sub_val.zip --output sub_val.zip
unzip -q sub_val.zip -d $TINY_COCO
mv $TINY_COCO/sub_val $TINY_COCO/val2017
curl -s https://gluoncv-ci.s3-us-west-2.amazonaws.com/mini_coco/instances_val2017_tiny.json --output instances_val2017_tiny.json
mv instances_val2017_tiny.json $TINY_COCO/annotations
curl -s https://gluoncv-ci.s3-us-west-2.amazonaws.com/tiny_motorbike.zip --output tiny_motorbike.zip
unzip -q tiny_motorbike.zip -d $TINY_MOTORBIKE
nosetests --with-timer --timer-ok 5 --timer-warning 20 -x --with-coverage --cover-package gluoncv -v tests/unittests
- name: Save github context info(For push)
if: ${{ github.event_name == 'push' }}
run: |
echo "${{ github.ref }}"
echo "${{ github.repository }}"
mkdir git_context
echo "${{ github.ref }}" > git_context/ref.atf
echo "${{ github.repository }}" > git_context/repo.atf
- name: Save github context info(For pull request)
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
run: |
echo "${{ github.event.pull_request.head.ref }}"
echo "${{ github.event.pull_request.head.repo.full_name }}"
echo "${{ github.event.number }}"
echo "${{ github.event.pull_request.head.sha }}"
mkdir git_context
echo "${{ github.event.pull_request.head.ref }}" > git_context/ref.atf
echo "${{ github.event.pull_request.head.repo.full_name }}" > git_context/repo.atf
echo "${{ github.event.number }}" > git_context/pr.atf
echo "${{ github.event.pull_request.head.sha }}" > git_context/sha.atf
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
path: git_context