Aas test engines compliance #25
Workflow file for this run
This file contains hidden or 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: ci | |
| on: [push, pull_request] | |
| env: | |
| X_PYTHON_VERSION: "3.10" | |
| jobs: | |
| sdk-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.8", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install coverage | |
| cd ./sdk | |
| pip install . | |
| - name: Test sdk with coverage + unittest | |
| run: | | |
| cd ./sdk | |
| coverage run -m unittest | |
| - name: Report test coverage | |
| if: ${{ always() }} | |
| run: | | |
| cd ./sdk | |
| coverage report -m | |
| api-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.8", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install coverage | |
| cd ./sdk | |
| pip install . | |
| cd .. | |
| cd ./api | |
| pip install .[dev] | |
| - name: Test sdk with coverage + unittest | |
| run: | | |
| cd ./api | |
| coverage run -m unittest | |
| - name: Report test coverage | |
| if: ${{ always() }} | |
| run: | | |
| cd ./api | |
| coverage report -m | |
| aas-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ "3.12" ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install coverage aas-test-engines uvicorn | |
| cd ./sdk | |
| pip install . | |
| cd ../api | |
| pip install .[dev] | |
| - name: Start FastAPI server | |
| run: | | |
| uvicorn server:app --host 127.0.0.1 --port 8080 & | |
| sleep 5 # Give the server time to start | |
| - name: Run aas-test-engines | |
| run: | | |
| aas_test_engines check_server http://127.0.0.1:8080 https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002 | |
| - name: Stop server | |
| if: ${{ always() }} | |
| run: | | |
| pkill -f "uvicorn" | |
| static-analysis: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.X_PYTHON_VERSION }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ env.X_PYTHON_VERSION }} | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pycodestyle mypy | |
| cd ./sdk | |
| pip install . | |
| - name: Check typing with MyPy | |
| run: | | |
| mypy sdk --exclude sdk/build | |
| - name: Check code style with PyCodestyle | |
| run: | | |
| pycodestyle --count --max-line-length 120 sdk | |
| readme-codeblocks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.X_PYTHON_VERSION }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ env.X_PYTHON_VERSION }} | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pycodestyle mypy codeblocks | |
| cd ./sdk | |
| pip install . | |
| - name: Check typing with MyPy | |
| run: | | |
| mypy <(codeblocks python README.md) | |
| - name: Check code style with PyCodestyle | |
| run: | | |
| codeblocks --wrap python README.md | pycodestyle --count --max-line-length 120 - | |
| - name: Run readme codeblocks with Python | |
| run: | | |
| codeblocks python README.md | python | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.X_PYTHON_VERSION }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ env.X_PYTHON_VERSION }} | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # TODO add autodoc test | |
| package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.X_PYTHON_VERSION }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ env.X_PYTHON_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -q build | |
| - name: Create source and wheel dist | |
| run: | | |
| ls | |
| cd ./sdk | |
| python -m build |