fea/add callable type to demo decorator #39
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: tests | |
on: | |
push: | |
branches: [dev, main] | |
pull_request: | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Lint with black | |
run: black . --check --diff | |
- name: Check typing with mypy | |
run: mypy . --check-untyped-defs | |
- name: Test with pytest | |
run: pytest -v | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Lint with black | |
run: black . --check --diff | |
- name: Check typing with mypy | |
run: mypy . --check-untyped-defs | |
- name: Get pytest coverage | |
run: pytest --cov-fail-under=100 --cov-report xml | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
spec: | |
runs-on: ubuntu-latest | |
name: examples / spec validation | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: pull validator | |
run: git clone https://github.com/opencomputeproject/ocp-diag-core.git --depth=1 | |
- name: Install go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: "1.17.6" | |
- name: run validator against examples | |
run: | | |
ROOT="$(pwd)" | |
cd ocp-diag-core/validators/spec_validator | |
PYTHONPATH="$ROOT" python -m examples list | | |
grep -v demo_python_logging_io | | |
xargs -I{} bash -c " | |
echo validating output of example {}... | |
PYTHONPATH=\"$ROOT\" python -m examples {} | | |
tee /dev/stderr | | |
go run . -schema ../../json_spec/output/root.json - | |
" |