|
1 | | -# This workflow will build a Java project with Maven |
2 | | -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| 1 | +# GitHub Actions Workflow for Gauge Selenium Java Web UI Automation |
3 | 2 |
|
4 | | -name: Gauge Java CI with Maven |
| 3 | +# This GitHub Actions workflow is designed to build a Maven project and execute Gauge Selenium tests using the Chrome browser. |
| 4 | +# The automation project utilizes Gauge, Selenium, Maven, and Java as its core technologies. |
| 5 | + |
| 6 | +# For more details on building and testing Java projects with Maven using GitHub Actions, please refer to the official documentation: |
| 7 | +# https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| 8 | + |
| 9 | +name: Gauge Selenium Java Web UI Automation CI |
5 | 10 |
|
6 | 11 | on: |
7 | 12 | push: |
8 | | - branches: [ master ] |
| 13 | + branches: |
| 14 | + - '**' |
9 | 15 | pull_request: |
10 | | - branches: [ master ] |
| 16 | + branches: |
| 17 | + - '**' |
11 | 18 |
|
12 | 19 | jobs: |
13 | 20 | build: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v3 |
| 25 | + |
| 26 | + - name: Set up JDK 11 |
| 27 | + uses: actions/setup-java@v3 |
| 28 | + with: |
| 29 | + java-version: '11' |
| 30 | + distribution: 'temurin' |
| 31 | + |
| 32 | + - name: Set up Maven 3.6.3 |
| 33 | + run: | |
| 34 | + wget -q https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz |
| 35 | + tar -xzf apache-maven-3.6.3-bin.tar.gz |
| 36 | + export PATH=$(pwd)/apache-maven-3.6.3/bin:$PATH |
14 | 37 |
|
| 38 | + - name: Set up Chrome browser |
| 39 | + uses: browser-actions/setup-chrome@latest |
| 40 | + with: |
| 41 | + chrome-version: 'latest' |
| 42 | + |
| 43 | + - name: Install Gauge using CURL |
| 44 | + run: curl -SsL https://downloads.gauge.org/stable | sh |
| 45 | + |
| 46 | + - name: Install Gauge-Java plugin |
| 47 | + run: gauge install java --version 0.7.4 |
| 48 | + |
| 49 | + test: |
15 | 50 | runs-on: ubuntu-latest |
| 51 | + needs: build |
16 | 52 |
|
17 | 53 | steps: |
18 | | - - uses: actions/checkout@v2 |
19 | | - - name: Set up JDK 1.8 |
20 | | - uses: actions/setup-java@v1 |
21 | | - with: |
22 | | - java-version: 1.8 |
23 | | - - name: Add Gauge's GPG key |
24 | | - run: sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-keys 023EDB0B |
25 | | - - name: Add Gauge to the repository list |
26 | | - run: echo deb https://dl.bintray.com/gauge/gauge-deb stable main | sudo tee -a /etc/apt/sources.list |
27 | | - - name: Install Gauge |
28 | | - run: sudo apt-get update && sudo apt-get install gauge |
29 | | - - name: Install Gauge-Java plugin |
30 | | - run: gauge install java --version 0.7.4 |
31 | | - - name: Build Test with Maven |
32 | | - run: mvn test-compile gauge:execute -DspecsDir="specs" -Denv="dev" |
| 54 | + - uses: actions/checkout@v3 |
| 55 | + |
| 56 | + - name: Check build environment |
| 57 | + run: | |
| 58 | + echo "Java version:" |
| 59 | + java -version |
| 60 | +
|
| 61 | + echo "Maven version:" |
| 62 | + mvn -version |
| 63 | +
|
| 64 | + echo "Chrome version:" |
| 65 | + google-chrome --version |
| 66 | +
|
| 67 | + - name: Execute regression test suite |
| 68 | + run: mvn test-compile gauge:execute -DspecsDir="specs" -Denv="dev" |
| 69 | + |
| 70 | + - name: Archive test reports |
| 71 | + if: always() |
| 72 | + uses: actions/upload-artifact@v3 |
| 73 | + with: |
| 74 | + name: test-reports |
| 75 | + path: reports |
0 commit comments