ci - tests using the DMTF Redfish-Mockup-Server container and DSP2043 #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Codecov | |
on: [push, pull_request] | |
jobs: | |
run: | |
name: test ${{ matrix.os }} / ${{ matrix.python }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: ["3.11","3.12"] | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python }} | |
services: | |
mockup: | |
image: dmtf/redfish-mockup-server:latest | |
volumes: | |
- ${{ github.workspace }}/tests/data/DSP8010/public-rackmount1:/tmp/public-rackmount1 | |
options: --name mockup | |
ports: | |
- 8000:8000 | |
steps: | |
- uses: actions/checkout@master | |
- uses: pdm-project/setup-pdm@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: install deps | |
run: | | |
pdm use -f $PYTHON | |
pdm install -d | |
# https://github.com/actions/virtual-environments/issues/1187 | |
- name: tune linux network | |
run: sudo ethtool -K eth0 tx off rx off | |
- name: Cache Description documents | |
id: cache-www-data | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-www-data | |
with: | |
path: ~/www-data/ | |
key: ${{ env.cache-name }}-20240527 | |
- if: ${{ steps.cache-www-data.outputs.cache-hit != 'true' }} | |
name: Get description documents | |
run: | | |
mkdir ~/www-data | |
wget --directory-prefix=$HOME/www-data https://www.dmtf.org/sites/default/files/standards/documents/DSP2043_2024.1.zip | |
wget --directory-prefix=$HOME/www-data https://www.dmtf.org/sites/default/files/standards/documents/DSP8010_2024.1.zip | |
wget --directory-prefix=$HOME/www-data https://www.snia.org/sites/default/files/technical-work/swordfish/release/v1.2.6/zip/Swordfish_v1.2.6.zip | |
unzip $HOME/www-data/Swordfish_v1.2.6.zip '*_Schema.zip' -d $HOME/www-data/ | |
- name: service::mock - unzip DSP8010 public-rackmount1 | |
run: | | |
mkdir -p ${{ github.workspace }}/tests/data/DSP8010/ | |
unzip $HOME/www-data/DSP2043_2024.1.zip "public-rackmount1/*" -d ${{ github.workspace }}/tests/data/DSP8010/ | |
- name: service::mock - copy service files | |
uses: docker://docker | |
with: | |
args: docker container exec mockup cp -a /mockup/public-rackmount1 /usr/src/app/ | |
- name: service::mock - restart to feed the volume | |
# https://github.com/orgs/community/discussions/42127#discussioncomment-7591609 | |
uses: docker://docker | |
with: | |
args: docker restart mockup | |
- name: Setup description documents | |
run: | | |
mkdir -p src/aiopenapi3_redfish/description_documents/DSP8010/2024.1/ | |
unzip -j ~/www-data/DSP8010_2024.1.zip 'openapi/*.yaml' -d src/aiopenapi3_redfish/description_documents/DSP8010/2024.1/ | |
mkdir -p src/aiopenapi3_redfish/description_documents/Swordfish/v1.2.6/ | |
unzip -j ~/www-data/Swordfish_v1.2.6_Schema.zip 'yaml/*.yaml' -d src/aiopenapi3_redfish/description_documents/Swordfish/v1.2.6/ | |
pdm run pytest --cov=tests/test_description_documents --cov-report=xml:./coverage/reports/coverage-description_documents-tests.xml tests/description_documents_test.py | |
- name: Generate coverage report (DSP 2043) | |
run: | | |
pdm run pytest --cov=src/aiopenapi3_redfish/ --cov-report=xml:./coverage/reports/coverage-dsp2043.xml tests/dsp2043_test.py::test_single_{pass,fail} | |
pdm run pytest --cov=tests/ --cov-report=xml:./coverage/reports/coverage-dsp2043-tests.xml tests/dsp2043_test.py::test_single_{pass,fail} | |
- name: Generate coverage report (mock) | |
run: | | |
pdm run pytest --cov=src/aiopenapi3_redfish/ --cov-report=xml:./coverage/reports/coverage-mock.xml tests/mock_test.py::test_iter | |
pdm run pytest --cov=tests/ --cov-report=xml:./coverage/reports/coverage-mock-tests.xml tests/dsp2043_test.py::test_iter | |
- name: Upload coverage to Codecov (core) | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage/reports/ | |
files: coverage-dsp2043.xml,coverage-mock.xml | |
env_vars: OS,PYTHON | |
fail_ci_if_error: false | |
flags: core | |
name: codecov-aiopenapi3_redfish | |
verbose: true | |
- name: Upload coverage to Codecov (tests) | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage/reports/ | |
files: coverage-description_documents-tests.xml,coverage-dsp2043-tests.xml,coverage-mock-tests.xml | |
env_vars: OS,PYTHON | |
fail_ci_if_error: false | |
flags: tests | |
name: codecov-aiopenapi3_redfish-tests | |
verbose: true |