Skip to content

Merge pull request #49 from ashikkumar23/package-update/202407171242/… #83

Merge pull request #49 from ashikkumar23/package-update/202407171242/…

Merge pull request #49 from ashikkumar23/package-update/202407171242/… #83

# The name of the workflow as it will appear in the "Actions" tab of the GitHub repository
name: Run API Tests and Generate Cypress Report
# Specifies the trigger for this workflow
on:
workflow_dispatch:
push:
branches:
- 'master'
# schedule:
# - cron: '0 8 1-31 * *'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "cypress-e2e-api"
cypress-e2e-api:
# Configures the job to run on the latest version of an Ubuntu Linux runner
runs-on: ubuntu-latest
name: Run on Chrome 107
# Cypress Docker image with Chrome v107 and Firefox v107 pre-installed
container:
image: cypress/browsers:node16.16.0-chrome107-ff107
options: --user 1001
steps:
# This action checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it
- name: Checkout repo
uses: actions/checkout@v3
# Clean install the necessary dependencies
- name: Install dependencies
run: |
npm ci
$(npm bin)/cypress cache path
$(npm bin)/cypress cache list
$(npm bin)/cypress verify
# Run tests in the Chrome browser
- name: Run Cypress tests
uses: cypress-io/github-action@v5
with:
browser: chrome
continue-on-error: true
env:
CYPRESS_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# Merge generated multiple JSON reports into a single index.json report file
- name: Merge test results into one
run: npm run report:merge
# Generate an HTML report from a single index.json report file
- name: Generate HTML report
run: npm run report:generate
# Publish generated static page i.e., index.html
- name: Publish report to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public