Skip to content

some restructurering #42

some restructurering

some restructurering #42

Workflow file for this run

name: Run Robotframework Tests
on:
push:
branches:
- main
paths:
- "demo/**"
workflow_dispatch:
env:
PROJECT_DIR: demo
APP_DIR: todo-app
REPORTS_DIR: reports
RFW_RESULTS_DIR: robotframework-results
jobs:
setup-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Node.js
run: |
curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
- name: Install Node Dependencies
run: npm install
working-directory: ${{ env.PROJECT_DIR }}/${{ env.APP_DIR }}
- name: Install Playwright Browser Dependencies
run: npx playwright install-deps
working-directory: ${{ env.PROJECT_DIR }}
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12.8"
- name: Install Hatch
run: pipx install hatch
- name: Run Test Cases
run: hatch run run-tests-ci
working-directory: ${{ env.PROJECT_DIR }}
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ env.RFW_RESULTS_DIR }}
path: ${{ env.PROJECT_DIR }}/${{ env.REPORTS_DIR }}
publish-test-results:
needs: setup-and-test
runs-on: ubuntu-latest
if: always()
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GHP_TOKEN }}
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.RFW_RESULTS_DIR }}
path: artifacts
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Deploy to GitHub Pages
env:
GHP_TOKEN: ${{ secrets.GHP_TOKEN }}
run: |
rm -rf public
mkdir -p public/${{ env.REPORTS_DIR }}
cp -r artifacts/** public/${{ env.REPORTS_DIR }}
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add public
git commit -m 'Deploy test results to GitHub Pages'
git push --force https://x-access-token:${GHP_TOKEN}@github.com/${{ github.repository }} HEAD:gh-pages