-
Notifications
You must be signed in to change notification settings - Fork 218
92 lines (80 loc) · 3.33 KB
/
pytest-testutils.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
80
81
82
83
84
85
86
87
88
89
90
91
92
---
# This workflow is meant as a foundational workflow for running integration/unit tests on the
# plaform. For this workflow we are testing the
#
# volttrontesting/testutils directory using pytest.
#
# This workflow also shows the caching mechanisms available for storage
# and retrieval of cache for quicker setup of test environments.
name: Testing testutils directory
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
#ubuntu-16.04
#os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
# checkout the volttron repository and set current direectory to it
- uses: actions/checkout@v2
- name: Set up Python ${{matrix.os}} ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- id: envcache
uses: actions/cache@v2
env:
cache-name: cache-env
with:
# This path is specific to Ubuntu
path: ./env
# Look to see if there is a cache hit for the corresponding requirements file
key: env-${{ matrix.os }}-${{matrix.python-version}}
#-${{hashFiles('requirements.py')}}
# env-${{ matrix.os }}-${{matrix.python-version}}
# restore-keys: |
# env-${{ matrix.os }}-${{matrix.python-version}}
- name: Install dependencies
if: steps.envcache.outputs.cache-hit != 'true'
run: |
echo "First cache hit?"
echo "${{steps.envcache.outputs.cache-hit}}"
echo "Second cache hit?"
echo "${{steps.cache.outputs.cache-hit}}"
pip install wheel
python bootstrap.py --all
- name: Install volttron
run: |
source env/bin/activate
pip install -e .
- name: Run pytest
run: |
source env/bin/activate
pip install -e .
pytest volttrontesting/testutils/test_docker_wrapper.py -o junit_family=xunit2 --junitxml=output/test-testutils-${{matrix.os}}-${{ matrix.python-version }}-results.xml
- name: Archive test results
uses: actions/upload-artifact@v2
if: always()
with:
name: pytest-report
path: output/test-testutils-${{matrix.os}}-${{ matrix.python-version }}-results.xml
# - name: Publish Unit Test Results
# uses: EnricoMi/[email protected]
# if: always()
# with:
# github_token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }}
# files: output/test-testutils*.xml
#-cov=com --cov-report=xml --cov-report=html
# pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Test with pytest
# run: |
# pytest --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html