-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
69 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,85 @@ | ||
name: Java CI with TestNG and Selenium | ||
name: Run tests | ||
env: | ||
ALLURE_VERSION: "2.10.0" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
release: | ||
types: # This configuration does not affect the page_build event above | ||
- created | ||
|
||
jobs: | ||
build: | ||
name: Tests on JDK | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
java: [ 11, 17 ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '11' | ||
java-version: ${{ matrix.java }} | ||
java-package: jdk | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Build with Maven | ||
run: mvn clean install -DskipTests=true | ||
id: build | ||
run: mvn clean install -DskipTests -ntp | ||
|
||
- name: Start Selenoid | ||
uses: Xotabu4/selenoid-github-action@v2 | ||
id: start-selenoid | ||
|
||
- name: Check Selenoid has been started | ||
run: curl http://localhost:4444/status | ||
|
||
- name: Tests | ||
id: functests | ||
timeout-minutes: 10 | ||
continue-on-error: true | ||
run: mvn test -ntp | ||
|
||
- name: Get Allure history | ||
uses: actions/checkout@v3 | ||
id: allure-setup | ||
continue-on-error: true | ||
with: | ||
ref: gh-pages | ||
path: gh-pages | ||
|
||
- name: Generate Allure report | ||
uses: simple-elf/allure-report-action@master | ||
with: | ||
allure_results: target/allure-results | ||
allure_report: target/allure-report | ||
allure_history: allure-history | ||
|
||
- name: Upload Allure report | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: Allure report | ||
path: target/allure-report | ||
|
||
- name: Deploy Allure report to Github Pages | ||
uses: peaceiris/actions-gh-pages@v2 | ||
env: | ||
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PUBLISH_BRANCH: gh-pages | ||
PUBLISH_DIR: allure-history | ||
|
||
- name: Run tests | ||
run: mvn test | ||
- name: Check tests are passed | ||
if: ${{ steps.functests.outcome != 'success' }} | ||
run: | | ||
echo Tests result: ${{ steps.functests.outcome }} | ||
exit 1 |