install toolium #1578
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: build | |
| on: | |
| pull_request: | |
| push: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements_ai.txt | |
| pip install -r requirements_dev.txt | |
| - name: Lint and format check with ruff | |
| run: | | |
| ruff check . | |
| ruff format --check . | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10'] # , '3.11', '3.12', '3.13'] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements_ai.txt | |
| pip install -r requirements_dev.txt | |
| python -m spacy download en_core_web_md | |
| - name: Test with pytest and coverage | |
| env: | |
| AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} | |
| AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} | |
| OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }} | |
| run: | | |
| coverage run --source=toolium -m pytest toolium/test | |
| - name: Publish on coveralls.io | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_FLAG_NAME: Python ${{ matrix.python-version }} | |
| COVERALLS_PARALLEL: true | |
| run: | | |
| coveralls --service=github | |
| coveralls: | |
| needs: tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --upgrade coveralls | |
| - name: Finalize publishing on coveralls.io | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| coveralls --finish | |
| examples-behave-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10'] # , '3.11', '3.12', '3.13'] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout toolium repository | |
| uses: actions/checkout@v6 | |
| - name: Checkout toolium-examples repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: Telefonica/toolium-examples | |
| ref: refs/heads/master | |
| path: toolium-examples | |
| - name: Set up python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install toolium dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install toolium | |
| run: | | |
| python setup.py install | |
| - name: Install toolium-examples dependencies | |
| run: | | |
| cd toolium-examples | |
| pip install -r requirements.txt | |
| pip install -r requirements_dev.txt | |
| - name: Run tests | |
| env: | |
| TOOLIUM_DRIVER_HEADLESS: Driver_headless=true | |
| run: | | |
| cd toolium-examples | |
| behave web_behave/features/ --junit --junit-directory web_behave/output/reports | |
| continue-on-error: true | |
| - name: Upload output folder | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: behave-tests-output-${{ matrix.python-version }} | |
| path: toolium-examples/web_behave/output | |
| - name: Publish test results | |
| uses: dorny/test-reporter@v3 | |
| if: always() | |
| with: | |
| name: behave tests results (${{ matrix.python-version }}) | |
| path: toolium-examples/web_behave/output/reports/*.xml | |
| reporter: java-junit | |
| fail-on-error: true | |
| examples-pytest-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10'] # , '3.11', '3.12', '3.13'] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout toolium repository | |
| uses: actions/checkout@v6 | |
| - name: Checkout toolium-examples repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: Telefonica/toolium-examples | |
| ref: refs/heads/master | |
| path: toolium-examples | |
| - name: Set up python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install toolium dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install toolium | |
| run: | | |
| python setup.py install | |
| - name: Install toolium-examples dependencies | |
| run: | | |
| cd toolium-examples | |
| pip install -r requirements.txt | |
| pip install -r requirements_dev.txt | |
| - name: Run tests | |
| env: | |
| TOOLIUM_DRIVER_HEADLESS: Driver_headless=true | |
| run: | | |
| cd toolium-examples/web_pytest | |
| python -m pytest --junitxml=output/reports/junit-pytest.xml | |
| continue-on-error: true | |
| - name: Upload output folder | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: pytest-tests-output-${{ matrix.python-version }} | |
| path: toolium-examples/web_pytest/output | |
| - name: Publish test results | |
| uses: dorny/test-reporter@v3 | |
| if: always() | |
| with: | |
| name: pytest tests results (${{ matrix.python-version }}) | |
| path: toolium-examples/web_pytest/output/reports/*.xml | |
| reporter: java-junit | |
| fail-on-error: true | |
| examples-nose2-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10'] # , '3.11', '3.12', '3.13'] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout toolium repository | |
| uses: actions/checkout@v6 | |
| - name: Checkout toolium-examples repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: Telefonica/toolium-examples | |
| ref: refs/heads/master | |
| path: toolium-examples | |
| - name: Set up python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install toolium dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install toolium | |
| run: | | |
| python setup.py install | |
| - name: Install toolium-examples dependencies | |
| run: | | |
| cd toolium-examples | |
| pip install -r requirements.txt | |
| pip install -r requirements_dev.txt | |
| - name: Run tests | |
| env: | |
| TOOLIUM_DRIVER_HEADLESS: Driver_headless=true | |
| run: | | |
| cd toolium-examples | |
| mkdir -p web_nose2/output/reports | |
| python -m nose2 web_nose2 -A '!local' --junit-xml-path web_nose2/output/reports/junit-nose.xml || true | |
| continue-on-error: true | |
| - name: Upload output folder | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: nose2-tests-output-${{ matrix.python-version }} | |
| path: toolium-examples/web_nose2/output | |
| - name: Publish test results | |
| uses: dorny/test-reporter@v3 | |
| if: always() | |
| with: | |
| name: nose2 tests results (${{ matrix.python-version }}) | |
| path: toolium-examples/web_nose2/output/reports/*.xml | |
| reporter: java-junit | |
| fail-on-error: true | |
| examples-playwright-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10'] # , '3.11', '3.12', '3.13'] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout toolium repository | |
| uses: actions/checkout@v6 | |
| - name: Checkout toolium-examples repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: Telefonica/toolium-examples | |
| ref: refs/heads/master | |
| path: toolium-examples | |
| - name: Set up python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install toolium dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install toolium | |
| run: | | |
| python setup.py install | |
| - name: Install toolium-examples dependencies | |
| run: | | |
| cd toolium-examples | |
| pip install -r requirements.txt | |
| pip install -r requirements_dev.txt | |
| pip install toolium[playwright] | |
| playwright install | |
| - name: Run tests | |
| env: | |
| TOOLIUM_DRIVER_HEADLESS: Driver_headless=true | |
| run: | | |
| cd toolium-examples | |
| behave web_playwright_behave/features --junit --junit-directory web_playwright_behave/output/reports/ | |
| continue-on-error: true | |
| - name: Upload output folder | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: playwright-tests-output-${{ matrix.python-version }} | |
| path: toolium-examples/web_playwright_behave/output | |
| - name: Publish test results | |
| uses: dorny/test-reporter@v3 | |
| if: always() | |
| with: | |
| name: playwright tests results (${{ matrix.python-version }}) | |
| path: toolium-examples/web_playwright_behave/output/reports/*.xml | |
| reporter: java-junit | |
| fail-on-error: true | |
| combine-output-artifacts: | |
| runs-on: ubuntu-latest | |
| needs: [examples-behave-tests, examples-pytest-tests, examples-nose2-tests, examples-playwright-tests] | |
| if: always() | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| path: all-artifacts | |
| - name: Create combined structure | |
| run: | | |
| mkdir -p tests-output | |
| echo "=== Downloaded artifacts ===" | |
| ls -la all-artifacts/ | |
| # Organize by framework and Python version | |
| for framework in behave pytest nose2 playwright; do | |
| mkdir -p "tests-output/$framework" | |
| for version in 3.10 3.11 3.12 3.13; do | |
| if [ -d "all-artifacts/${framework}-tests-output-${version}" ]; then | |
| echo "Moving $framework Python $version output..." | |
| mv "all-artifacts/${framework}-tests-output-${version}" "tests-output/$framework/python-${version}" | |
| fi | |
| done | |
| done | |
| echo "=== Combined structure ===" | |
| tree tests-output || find tests-output -type d | |
| echo "=== Total files ===" | |
| find tests-output -type f | wc -l | |
| - name: Upload combined output artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: tests-output | |
| path: tests-output/ |