Skip to content

Commit 0615d71

Browse files
committed
Unit tests dir structure and GA workflow
1 parent bad9fc9 commit 0615d71

File tree

5 files changed

+202
-78
lines changed

5 files changed

+202
-78
lines changed

.github/workflows/unit_tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Unit tests
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
submodules: true
15+
- name: Set up Python
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.7
19+
- name: Install dependencies
20+
run: |
21+
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
22+
curl https://pyenv.run | bash
23+
export PATH="~/.pyenv/bin:$PATH"
24+
eval "$(pyenv init -)"
25+
pyenv install 3.7.8
26+
pyenv local 3.7.8
27+
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
28+
source ~/.poetry/env
29+
- name: Test with pytest
30+
run: |
31+
export PATH="~/.pyenv/bin:$PATH"
32+
eval "$(pyenv init -)"
33+
source ~/.poetry/env
34+
poetry install
35+
poetry run pytest -v --cov=pytest_splunk_addon --cov-report=html tests/unit
36+
- name: Archive test coverage results
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: code-coverage-report-unit-tests
40+
path: htmlcov

0 commit comments

Comments
 (0)