forked from faucetsdn/poseidon
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 2.02 KB
/
test.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
name: test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: shell_test
run: |
wget "https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz" && \
tar --xz -xvf "shellcheck-stable.linux.x86_64.tar.xz" && \
shellcheck() { "shellcheck-stable/shellcheck" "$@"; } && \
shellcheck --version && \
/bin/bash --version && /bin/bash -n bin/poseidon && shellcheck -x -e SC2016 -e SC2119 -e SC2129 -e SC2001 -e SC2044 bin/poseidon
- name: unit_test
run: |
export DEBIAN_FRONTEND=noninteractive && \
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
export PYTHONPATH=$PWD/poseidon:$PYTHONPATH
export POSEIDON_CONFIG=$PWD/config/poseidon.config
echo "127.0.0.1 localhost redis" | sudo tee -a /etc/hosts
sudo apt-get update && \
sudo apt-get install -yq --no-install-recommends python3.7 python3.7-dev && \
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 && \
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2 && \
sudo apt-get install tshark && \
docker run -d -p 6379:6379 redis:latest && \
pip3 install -U pip && \
pip3 install codecov scikit-build && \
find . -name requirements.txt -type f -exec pip3 install -r {} \; && \
find . -name test-requirements.txt -type f -exec pip3 install -r {} \; && \
export PATH=/home/runner/.local/bin:$PATH && \
py.test -v -vv --cov-report term-missing --cov=. -c .coveragerc && \
coverage report && coverage xml
- name: docker_test
run: make run_tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: github.repository == 'cyberreboot/poseidon' && github.event_name == 'push'