Skip to content

Commit

Permalink
Use volttron-build-action for all of the workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
craig8 committed Jul 27, 2021
1 parent ef7c32c commit 7861031
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 82 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/pytest-testutils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,10 @@ jobs:
test_path: volttrontesting/testutils
test_output_suffix: testutils

# Archive the results from the pytest to storage.
# Archive the results from the pytest to storage.
- 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
71 changes: 10 additions & 61 deletions .github/workflows/pytest-vctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,55 +35,24 @@ jobs:

# Each step will be run in order of listing.
steps:
# checkout the volttron repository and set current direectory to it
# checkout the volttron repository and set current directory to it
- uses: actions/checkout@v2

# Install erlang for rabbitmq
- name: Install erlang
if: matrix.os != 'ubuntu-20.04'
run: |
sudo scripts/rabbit_dependencies.sh debian ${{ matrix.os }}
# setup the python environment for the operating system
# Attempt to restore the cache from the build-dependency-cache workflow if present then
# the output value steps.check_files.outputs.files_exists will be set (see the next step for usage)
- name: Set up Python ${{matrix.os}} ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

# Attempt to restore the cache from the build-dependency-cache workflow if present then
# the output value steps.check_files.outputs.files_exists will be set (see the next step for usage)
- name: Has restored cache
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "env/bin/activate"

# This step is only run if the cache wasn't able to be restored.
- name: Install dependencies including rmq
if: steps.check_files.outputs.files_exists != 'true' && matrix.os != 'ubuntu-20.04'
run: |
pip install wheel
python bootstrap.py --all --rabbitmq --force
- name: Install dependencies other than rmq
if: steps.check_files.outputs.files_exists != 'true' && matrix.os == 'ubuntu-20.04'
run: |
pip install wheel
python bootstrap.py --all --force
- name: Install volttron
run: |
source env/bin/activate
pip install -e .
# Run the specified tests and save the results to a unique file that can be archived for later analysis.
- name: Run pytest
run: |
source env/bin/activate
pip install pytest-rerunfailures
pip install -e .
pytest volttrontesting/platform/control_tests \
-rf -o junit_family=xunit2 --junitxml=output/test-vctl-${{matrix.os}}-${{ matrix.python-version }}-results.xml
- name: Run pytest on ${{ matrix.python-version }}, ${{ matrix.os }}
uses: volttron/volttron-build-action@v1
with:
python_version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
test_path: volttrontesting/platform/control_tests
test_output_suffix: control_tests

# Archive the results from the pytest to storage.
- name: Archive test results
Expand All @@ -92,23 +61,3 @@ jobs:
with:
name: pytest-report
path: output/test-vctl-${{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

0 comments on commit 7861031

Please sign in to comment.