-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (81 loc) · 3.49 KB
/
manually-triggered-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Testing Deployed Website
on:
workflow_dispatch:
inputs:
TESTING_URL:
description: 'Choose which website should be tested'
type: choice
required: true
default: 'MAIN'
options:
- MAIN
- STAGE
- DEVELOP
concurrency:
group: self-hosted-${{ github.head_ref || github.ref }}-${{github.event.inputs.TESTING_URL}}
cancel-in-progress: true
jobs:
cypress-tests:
name: 🔊 Cypress Tests - ${{ matrix.browser }} Browser
strategy:
fail-fast: false
matrix:
browser: [Chrome , Firefox]
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out the repository code
uses: actions/checkout@v2
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Installing yarn packages
run: yarn
- name: Remove the reports
run: yarn ci:remove:reports
- name: Set the project environment to ${{github.event.inputs.TESTING_URL}}
run: yarn firebase use ${{github.event.inputs.TESTING_URL}} --token ${{ secrets.FIREBASE_TOKEN }}
- name: Auto generating the firebase configuration
run: yarn firebase apps:sdkconfig web --token ${{ secrets.FIREBASE_TOKEN }} --json | tail -n +3 |head -n -1 > ./src/utasks-configuration.json
- name: Decrypt the envs and cypress env files
run: ./.github/scripts/decrypt_secrets.sh
env:
DECRYPT_SECRETS_PASSPHRASE: ${{ secrets.DECRYPT_SECRETS_PASSPHRASE }}
- run: echo "🖥️ The workflow is now ready to start cypress tests the ${{ github.repository }} code in the ${{matrix.browser}} browser."
- name: 🙈 UI Tests - On ${{ matrix.browser }}
id: uiTest
uses: cypress-io/github-action@v2
with:
install: false
browser: ${{ matrix.browser }}
headless: true
command: yarn ci:cy:run -- --env TESTING_URL=${{github.event.inputs.TESTING_URL}}
- name: 👀 Generate the testing report
if: always()
run: yarn ci:code:test:report
- name: Publish the reports on GitHub - on success
uses: actions/upload-artifact@v2
if: ${{ contains( steps.uiTest.outcome , 'success' ) }}
with:
name: Utasks-${{github.event.inputs.TESTING_URL}}-${{ matrix.browser }}-cypress-reports-success-${{ github.sha }}
path: |
cypress/reports/mochawsome/**.html
- name: Publish the reports on GitHub - on failure
uses: actions/upload-artifact@v2
if: ${{ failure() && contains( steps.uiTest.outcome , 'failure' ) }}
with:
name: Utasks-${{github.event.inputs.TESTING_URL}}-${{ matrix.browser }}-cypress-reports-failure-${{ github.sha }}
path: |
cypress/reports/mochawsome/**.html
cypress/reports/screenshots/**
cypress/reports/videos/**
!cypress/reports/.nyc_output
!cypress/reports/coverage
!cypress/reports/downloads