Fixing issues with PercevalBackend and adding PermanentBackend #452
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: main | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| pull_request: | |
| env: | |
| SRC_DIR: optyx | |
| TEST_DIR: test | |
| DOCS_DIR: docs | |
| PYTHON_VERSION: 3.11 | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: 'pip' # caching pip dependencies | |
| - name: Install | |
| run: | |
| pip install .[test] | |
| - name: pflake8 | |
| run: | |
| pflake8 ${{ env.SRC_DIR }} | |
| - name: pylint | |
| run: | |
| pylint ${{ env.SRC_DIR }} --fail-under=9 | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: 'pip' # caching pip dependencies | |
| - name: Install | |
| run: | |
| pip install .[test] | |
| - name: Test | |
| run: | |
| coverage run -m pytest | |
| - name: Coverage | |
| run: | |
| coverage report --fail-under=95 --show-missing | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: 'pip' | |
| - name: Cache | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env.DOCS_DIR }}/_api | |
| ${{ env.DOCS_DIR }}/_build | |
| key: ${{ runner.os }}-docs-${{ hashFiles(format('{0}/**', env.SRC_DIR), format('{0}/**', env.DOCS_DIR)) }} | |
| restore-keys: | | |
| ${{ runner.os }}-docs | |
| - name: Install | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pandoc | |
| pip install .[docs] | |
| - name: Build | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: | | |
| sphinx-build ${{ env.DOCS_DIR }} ${{ env.DOCS_DIR }}/_build/html | |
| - name: Store | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs | |
| path: ${{ env.DOCS_DIR }}/_build/html | |