Skip to content

run-daily-tests

run-daily-tests #275

# This workflow will build APOD app and run playwright tests against same.
name: run-daily-tests
on:
schedule:
- cron: '0 11 * * *'
workflow_dispatch:
jobs:
run-daily-tests:
name: Run Daily Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@master
- name: Pull docker image for apodview and apodapi
shell: sh
run: |
#!/bin/sh
# Pull apod-view:latest
sudo docker pull mail2prajwal12/apod-view:latest
sudo docker run -itd -p 7777:7777 --name apod-view mail2prajwal12/apod-view:latest
# Pull the Docker Image
sudo docker pull mail2prajwal12/apod-api:latest
sudo docker run -itd -p 8888:8888 --name apod-api mail2prajwal12/apod-api:latest
- name: Run the playwright tests
run: npm ci && ENV=stable npx cucumber-js --tags=@all
- name: Send Slack Notification using test-results-reporter
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: npx test-results-reporter publish -c test-results-reporter-config.json
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: test-reports
path: reports
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: reports # The folder the action should deploy.
slack-notification:
name: Slack Notification On Test Completion
runs-on: ubuntu-latest
needs: run-daily-tests
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_MESSAGE: 'Test Completed :rocket:'
SLACK_TITLE: Playwright Cucumber Daily Tests
SLACK_COLOR: ${{ job.status }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}