-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (101 loc) · 3.55 KB
/
Copy pathgithub-actions-pipeline.yml
File metadata and controls
103 lines (101 loc) · 3.55 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
name: WordPress CI
on:
push:
branches:
- '**'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_2 }}
jobs:
Build:
runs-on: ubuntu-20.04
steps:
- name: Cancel previous redundant builds
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: echo "🖥️ Building..."
- name: Cloning repository
run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: Github commit for reporting
run: echo "💡 The GitHub commit is 1.0."${GITHUB_SHA::6}
CodeInspection:
runs-on: ubuntu-20.04
needs: Build
steps:
- name: Cloning repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '16.0.2'
distribution: 'adopt'
- name: Grant execute permissions for gradlew
run: chmod +x gradlew
- name: SonarQube Scan
run: |
export TAG_VERSION=1.0.${GITHUB_SHA::6}
./gradlew sonarqube -PenvId="QA01" -PbuildNumber=$TAG_VERSION
RunSmokeTests:
runs-on: ubuntu-20.04
needs: CodeInspection
steps:
- name: cloning repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '16.0.2'
distribution: 'adopt'
- name: Grant execute permissions for gradlew
run: chmod +x gradlew
- name: Build API Testing framework
run: |
export TAG_VERSION=1.0.${GITHUB_SHA::6}
./gradlew clean executeFeatures -PenvId="QA01" -PcucumberOptions="@Smoke" -PbuildNumber=$TAG_VERSION
- name: Publish cucumber Smoke report
uses: deblockt/cucumber-report-annotations-action@v1.7
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "build/cucumber/*.json"
- 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: ./reports/cucumber-html-reports
RunRegressionTests:
runs-on: ubuntu-20.04
needs: RunSmokeTests
steps:
- name: cloning repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '16.0.2'
distribution: 'adopt'
- name: Grant execute permissions for gradlew
run: chmod +x gradlew
- name: Run Tests
run: |
export TAG_VERSION=1.0.${GITHUB_SHA::6}
./gradlew clean executeFeatures -PenvId="QA01" -PcucumberOptions="@Regression and not @Bug" -PbuildNumber=$TAG_VERSION
- name: Publish cucumber Regression report
uses: deblockt/cucumber-report-annotations-action@v1.7
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "build/cucumber/*.json"
- name: Send email
uses: dawidd6/action-send-mail@v3.6.1
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
subject: Wordpress CI Report
to: agustin.mediotti@fundacion-jala.org, sergio.mendieta@fundacion-jala.org, adrian.oviedo@fundacion-jala.org, jimy.tastaca@fundacion-jala.org, saul.fuentes@fundacion-jala.org
from: WordPress CI
secure: true
body: Build job of ${{github.repository}} completed successfully!