add github pages result site link #43
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: Run Tests | |
| on: | |
| workflow_dispatch: # 👈 enables manual trigger | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| BASE_URL_FE: https://ultimateqa.com/complicated-page # <-- Set your actual BASE_URL here | |
| BASE_URL_API: https://jsonplaceholder.typicode.com | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: '22' | |
| - name: Install Allure Commandline | |
| run: npm install -g allure-commandline --save-dev | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install all Playwright Browsers | |
| run: | | |
| source .venv/bin/activate | |
| python -m playwright install --with-deps | |
| - name: Create .env file from workflow | |
| run: | | |
| echo "BASE_URL_FE=${BASE_URL_FE}" > .env | |
| echo "BASE_URL_API=${BASE_URL_API}" > .env | |
| - name: Download previous Allure report | |
| run: | | |
| git config --global user.email "github-actions@users.noreply.github.com" | |
| git config --global user.name "GitHub Actions" | |
| git clone --depth=1 --branch gh-pages https://github.com/${{ github.repository }} gh-pages || exit 0 | |
| mkdir -p allure-results/history | |
| cp -R gh-pages/history allure-results/ || echo "No previous history" | |
| - name: Run tests(UI & API) with Pytest | |
| run: | | |
| source .venv/bin/activate | |
| pytest Ultimateqa/ui_tests api_tests -n auto --alluredir=allure-results | |
| - name: Generate Allure Report | |
| if: always() | |
| run: | | |
| npx allure generate allure-results --clean -o allure-report | |
| - name: Deploy Allure Report to GitHub Pages | |
| if: always() | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GH_PAGES_ALLURE }} | |
| publish_branch: gh_pages | |
| publish_dir: ./allure-report | |
| - name: Output report link | |
| if: always() | |
| run: | | |
| echo "### ✅ [View Allure Report](https://amielnoy.github.io/forcePointPlaywrightPythonTest)" >> $GITHUB_STEP_SUMMARY | |