Skip to content

Commit

Permalink
Added tapio-qa workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjovcheska committed Jul 26, 2023
1 parent c778afb commit 0fb17fa
Showing 1 changed file with 176 additions and 0 deletions.
176 changes: 176 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
name: E2E (tapio-qa)

# Trigger this workflow on merge (push the code to the main)
on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label ||
github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
e2e-chrome:
runs-on: ubuntu-latest
steps:
- name: Checkout nutsfinance/tapio-qa private repo
uses: actions/checkout@main
with:
repository: nutsfinance/tapio-qa
token: ${{ secrets.GH_PAT }} #Please provide your Personal Access Token

- name: Install pnpm
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # pin@v2.2.4

- name: Setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # pin@v3.6.0
with:
node-version: 18.16

- name: Set pnpm cache directory
run: pnpm config set store-dir .pnpm-store
continue-on-error: true

- name: Setup cache
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # pin@v2
with:
path: |
.pnpm-store
node_modules
/home/runner/.cache/Cypress
key: ${{ runner.os }}-pnpm-v1-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-v1-
continue-on-error: true

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Install linux deps
run: |
sudo apt-get install --no-install-recommends -y \
fluxbox \
xvfb
- name: Run xvfb and fluxbox as virtual monitors
run: |
Xvfb :0 -screen 0 1024x768x24 -listen tcp -ac &
fluxbox &
env:
DISPLAY: :0.0

- name: Run e2e tests (cypress-action)
uses: cypress-io/github-action@cdbbcd60fb5d967d7a37d8eb148add76a7ded7b6 # pin@v5.1.0
continue-on-error: true
with:
command: pnpm cypress:run:chrome
browser: chrome
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
DISPLAY: :0.0
- name: Generate HTML report
run: |
pnpm run posttest
- name: Archive e2e artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v2
if: always()
with:
name: e2e-artifacts
path: |
/home/runner/work/tapio-eth/tapio-eth/output.html
/home/runner/work/tapio-eth/tapio-eth/cypress/mochawesome-report
/home/runner/work/tapio-eth/tapio-eth/cypress/e2e/videos
/home/runner/work/tapio-eth/tapio-eth/cypress/e2e/screenshots
continue-on-error: true
- name: Send Slack notification
uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} # Please add this URL to secrets https://hooks.slack.com/services/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
e2e-edge:
runs-on: ubuntu-latest

steps:
- name: Checkout nutsfinance/tapio-qa private repo
uses: actions/checkout@main
with:
repository: nutsfinance/tapio-qa
token: ${{ secrets.GH_PAT }} #Please provide your Personal Access Token

- name: Install pnpm
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # pin@v2.2.4

- name: Setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # pin@v3.6.0
with:
node-version: 18.16

- name: Set pnpm cache directory
run: pnpm config set store-dir .pnpm-store
continue-on-error: true

- name: Setup cache
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # pin@v2
with:
path: |
.pnpm-store
node_modules
/home/runner/.cache/Cypress
key: ${{ runner.os }}-pnpm-v1-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-v1-
continue-on-error: true

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Install linux deps
run: |
sudo apt-get install --no-install-recommends -y \
fluxbox \
xvfb
- name: Run xvfb and fluxbox as virtual monitors
run: |
Xvfb :0 -screen 0 1024x768x24 -listen tcp -ac &
fluxbox &
env:
DISPLAY: :0.0

- name: Run e2e tests (cypress-action)
uses: cypress-io/github-action@cdbbcd60fb5d967d7a37d8eb148add76a7ded7b6 # pin@v5.1.0
continue-on-error: true
with:
command: pnpm cypress:run:edge
browser: edge
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
DISPLAY: :0.0
- name: Generate HTML report
run: |
pnpm run posttest
- name: Archive e2e artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v2
if: always()
with:
name: e2e-artifacts
path: |
/home/runner/work/tapio-eth/tapio-eth/output.html
/home/runner/work/tapio-eth/tapio-eth/cypress/mochawesome-report
/home/runner/work/tapio-eth/tapio-eth/cypress/e2e/videos
/home/runner/work/tapio-eth/tapio-eth/cypress/e2e/screenshots
continue-on-error: true
- name: Send Slack notification
uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} # Please add this URL to secrets https://hooks.slack.com/services/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

0 comments on commit 0fb17fa

Please sign in to comment.