Added testcases and made few changes #5
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
name: Test Workflow | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
java-package: 'jdk' | |
architecture: 'x64' | |
check-latest: false | |
server-id: 'github' | |
server-username: ${{ github.actor }} | |
server-password: ${{ github.token }} | |
overwrite-settings: true | |
job-status: 'success' | |
- 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 WireGuard | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wireguard | |
sudo cp scripts/openg2p-e2e.conf /etc/wireguard/ | |
sudo systemctl start wg-quick@openg2p-e2e.service | |
- name: Chrome setup | |
uses: browser-actions/setup-chrome@v1 | |
- run: google-chrome --version | |
- name: Chromedriver setup | |
uses: nanasess/setup-chromedriver@v2 | |
- run: | | |
export DISPLAY=:99 | |
chromedriver --url-base=/wd/hub & | |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional | |
- name: Build with Maven | |
run: mvn clean install -DskipTests=true | |
- name: Run Sanity tests | |
run: mvn clean test | |
- name: Clear Allure report history | |
run: rm -rf allure-results/* | |
- name: Generate Allure report | |
run: mvn allure:report | |
- name: Deploy report to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: target/site/allure-maven-plugin | |
- name: Post the link to the report | |
uses: actions/github-script@v4 | |
if: always() | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const response = await octokit.repos.createCommitStatus({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
sha: context.sha, | |
state: 'success', | |
target_url: 'https://Yashavant1629.github.io/openg2p-testing/allure-maven-plugin/index.html', | |
context: 'Test report' | |
}); | |
console.log(response); |