-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (112 loc) · 3.81 KB
/
Copy pathreusable-workflow.yml
File metadata and controls
126 lines (112 loc) · 3.81 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# This workflow can be run manually by providing inputs
name: reusable-workflow
on:
workflow_call:
inputs:
test-environment:
description: 'local or development'
required: true
type: string
default: "local"
tests-to-execute:
description: 'Provide tags separated by comma. Possible values : unit,sanity,login,signup'
required: true
type: string
default: "unit"
tests-to-exclude:
required: false
type: string
default: "failing,flaky"
jobs:
build:
runs-on: ubuntu-latest
steps:
#### Below steps are commented as there is an issue with app deployment
# - name: Checkout app repository
# uses: actions/checkout@v3
# with:
# repository: avighub/cypress-realworld-app
# ref: develop
#
# - name: Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '20.11.0'
#
# - name: Cache npm dependencies
# uses: actions/cache@v2
# with:
# path: ~/.npm
# key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-npm-
#
# - name: Install Yarn
# run: npm install yarn@latest -g
#
# - name: Install npm dependencies
# run: yarn
#
# - name: start app
# run: nohup yarn start &
#
# - name: Wait for app to start
# run: sleep 30
# This step is to check API, remove it when issue with App is fixed
# - name: Test API
# uses: sozo-design/curl@v1.0.2
# with:
# args: http://localhost:3001/users
# - name: Move to previous dir
# run: cd ..
- name: Checkout automation framework repository
uses: actions/checkout@v3
- name: Unlock secrets
uses: sliteteam/github-action-git-crypt-unlock@1.2.0
env:
GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY }}
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: >-
mvn clean test
-DexcludedGroups=${{inputs.tests-to-exclude}}
-Dgroups=${{inputs.tests-to-execute}}
-Denvironment=${{inputs.test-environment}}
-DTRIGGERED_BY="${{github.event_name}}"
- name: Load test report history
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Build test report
uses: simple-elf/allure-report-action@v1.7
if: always()
with:
gh_pages: gh-pages
allure_history: allure-history
allure_results: allure-results
keep_reports: 30
- name: Publish test report
uses: peaceiris/actions-gh-pages@v3
if: always()
with:
github_token: ${{ secrets.ALLURE_REPORT }} # Create personal token and add as repository secret
publish_branch: gh-pages
publish_dir: allure-history
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6