Add CI config #19
Workflow file for this run
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: Tests | |
on: | |
# Triggers the workflow manually from the GitHub Actions tab | |
workflow_dispatch: | |
# Runs the workflow on every push to the repository | |
push: | |
# Runs the workflow on every push to the repository | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- closed | |
branches: | |
- master | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: false | |
jobs: | |
cy-test: | |
runs-on: ubuntu-22.04 | |
name: Run Cypress Tests | |
strategy: | |
# don't fail the entire matrix on failure | |
fail-fast: false | |
matrix: | |
# Run the job in parallel on different browser | |
browser: | |
- chrome | |
- firefox | |
- edge | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cypress-io/github-action@v6 | |
with: | |
build: npm run cy:info | |
wait-on-timeout: 120 | |
browser: ${{ matrix.browser }} | |
# record: true | |
# parallel: true | |
# group: 'Cy-${{ matrix.browser }}' | |
spec: cypress/e2e/1-getting-started | |
config-file: cypress.config.js | |
env: | |
# CYPRESS_PROJECT_ID: ${{ secrets.SORRY_CYPRESS_PROJECT_ID }} | |
# CYPRESS_RECORD_KEY: ${{ secrets.SORRY_CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEBUG: 'cypress:server:args' | |
# - name: Upload Cypress Html Reports | |
# uses: actions/upload-pages-artifact@v3 | |
# with: | |
# # Upload reports | |
# name: cypress-report | |
# path: 'cypress/reports' | |
# retention-days: 3 | |
# - name: Deploy to GitHub Pages | |
# id: deployment | |
# uses: actions/deploy-pages@v4.0.5 | |
- name: Upload Cypress HTML Reports | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.browser }}-report | |
path: 'cypress/reports' | |
retention-days: 3 | |
deploy-reports: | |
runs-on: ubuntu-22.04 | |
needs: cy-test | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout Repository | |
- name: Download Chrome Report | |
uses: actions/download-artifact@v4 | |
with: | |
name: chrome-report | |
path: chrome-report | |
- name: Display structure of downloaded files | |
run: | | |
pwd | |
ls -l | |
- name: Download Firefox Report | |
uses: actions/download-artifact@v4 | |
with: | |
name: firefox-report | |
path: firefox-report | |
- name: Display structure of downloaded files | |
run: | | |
pwd | |
ls -l | |
- name: Download Edge Report | |
uses: actions/download-artifact@v4 | |
with: | |
name: edge-report | |
path: edge-report | |
- name: Display structure of downloaded files | |
run: | | |
pwd | |
ls -l | |
- name: Copy Reports to Specific Directories | |
run: | | |
mkdir -p gh-pages/chrome | |
mkdir -p gh-pages/firefox | |
mkdir -p gh-pages/edge | |
cp report/index.html gh-pages | |
cp -r chrome-report gh-pages/chrome/ | |
cp -r firefox-report gh-pages/firefox/ | |
cp -r edge-report gh-pages/edge/ | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./gh-pages | |
publish_branch: gh-pages |