Run smoke/sanity automation scripts on the production. #481
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: Run smoke/sanity automation scripts on the production. | |
on: | |
schedule: ## Schedule the job to run at 6:00.am daily. | |
- cron: '0 6 * * *' | |
jobs: | |
cypress-test: | |
strategy: | |
matrix: | |
node-version: [ 18.x ] | |
os: [ ubuntu-latest ] | |
browser: [ chrome, firefox ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: | | |
npm ci --force | |
- name: Run cypress smoke and sanity automation scripts. | |
uses: cypress-io/github-action@v4 | |
with: | |
command: npm run cypress:run:production:test -- --browser ${{ matrix.browser }} | |
parallel: true | |
- name: Generate Allure Report | |
uses: simple-elf/allure-report-action@master | |
if: always() | |
with: | |
allure_results: allure-results | |
- name: Deploy report to Github Pages | |
if: always() | |
uses: peaceiris/actions-gh-pages@v2 | |
env: | |
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PUBLISH_BRANCH: gh-pages | |
PUBLISH_DIR: allure-report | |
- name: send custom message | |
uses: appleboy/telegram-action@master | |
if: success() | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: | | |
Repository: ${{ github.repository }} | |
The ${{ github.event_name }} event triggered smoke and sanity. | |
The ${{ github.job }} are pass. | |
The ${{ github.workflow }} are pass. | |
- name: send custom message | |
uses: appleboy/telegram-action@master | |
if: failure() | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: | | |
Repository: ${{ github.repository }} | |
The ${{ github.event_name }} event triggered smoke and sanity. | |
The ${{ github.job }} are fail. | |
The ${{ github.workflow }} are fail. |