This repository was archived by the owner on Oct 13, 2025. It is now read-only.
Repository navigation
100 lines (95 loc) · 3.51 KB
/
Copy pathtest.yml
File metadata and controls
100 lines (95 loc) · 3.51 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Test
on: [push, pull_request]
jobs:
cancel-previous-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/master'"
unit-tests:
name: Unit Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel coverage
pip install -r requirements.txt
- name: Compile Proto
run: python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. ./silk/tools/pb/visualize_grpc.proto
- name: Install
run: python setup.py install
- name: Test
run: |
python -m coverage run --parallel-mode silk/unit_tests/test_log_replay.py
python -m coverage run --parallel-mode silk/unit_tests/test_otns_manager.py
python -m coverage run --parallel-mode silk/unit_tests/test_utilities.py
- name: Combine coverage reports
run: python -m coverage combine
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
integration-tests:
name: Integration Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest]
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.14
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel coverage
pip install -r requirements.txt
- name: Compile Proto
run: python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. ./silk/tools/pb/visualize_grpc.proto
- name: Install OTNS
run: |
OTNS_PATH="$HOME/src/otns"
mkdir -p $(go env GOPATH)/bin
mkdir -p $OTNS_PATH
git clone https://github.com/openthread/ot-ns.git $OTNS_PATH
cd $OTNS_PATH
./script/install-deps
go get ./cmd/otns
go get ./cmd/real/...
cd pylibs
python setup.py install
- name: Install
run: python setup.py install
- name: Test
run: |
export PATH=$PATH:$(go env GOPATH)/bin
python -m coverage run silk/unit_tests/test_otns.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1