Update CO-intro1.test.js #9
This file contains 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: Playwright Tests | |
on: | |
push: | |
schedule: | |
- cron: '0 14 * * *' | |
jobs: | |
run-tests: | |
name: Run Playwright Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
ref: main # Use the main branch here | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Create .env file from secrets | |
run: | | |
echo "CREDENTIALS={\"codioemail\":\"${{ secrets.CODIOEMAIL }}\",\"codiopass\":\"${{ secrets.CODIOPASS }}\"}" > .env | |
- name: Install Dependencies | |
run: npm install | |
- name: Install Browsers | |
run: npx playwright install | |
- name: Run Playwright Tests | |
run: npx playwright test | |
- name: Prepare Historical Data for Allure Report | |
run: | | |
if [ -d "allure-report/history" ]; then | |
mkdir -p .github/history | |
cp -R "allure-report/history"/* ".github/history" | |
fi | |
- name: Generate Allure Report | |
run: | | |
npm install -g allure-commandline | |
allure generate allure-results --clean -o allure-report | |
- name: Commit and Push Allure Results and Reports | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
git add .github/history | |
git commit -m "Update historical Data Allure" || echo "No changes to commit" | |
git push origin main | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./allure-report | |
branch: main # Ensure this is the branch you want to deploy to |