name: workflow

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout GitHub repo
      uses: actions/checkout@v2
    - name: Set up Java
      uses: actions/setup-java@v1
      with:
        java-version: '11'
    - name: Start Xvfb
      run: Xvfb :99 &
    - name: Run tests
      run: mvn -B test
      env:
        DISPLAY: :99
        WDM_GITHUBTOKENNAME: ${{ secrets.WDM_GITHUBTOKENNAME }}
        WDM_GITHUBTOKENSECRET: ${{ secrets.WDM_GITHUBTOKENSECRET }}
    - name: Upload analysis to SonarCloud
      run: >
        mvn -B sonar:sonar
        -Dsonar.host.url=https://sonarcloud.io
        -Dsonar.organization=bonigarcia-github
        -Dsonar.projectKey=io.github.bonigarcia:selenium-jupiter
      env:
        GITHUB_TOKEN: ${{ secrets.WDM_GITHUBTOKENSECRET }}
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1

name: workflow

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env:
  DISPLAY: :99
  WDM_GITHUBTOKEN: ${{ secrets.WDM_GITHUBTOKEN }}
  SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout GitHub repo
      uses: actions/checkout@v2
    - name: Set up Java
      uses: actions/setup-java@v1
      with:
        java-version: '11'
    - name: Start Xvfb
      run: Xvfb :99 &
    - name: Run tests
      run: mvn -B test
    - name: Upload analysis to SonarCloud
      run: >
        mvn -B sonar:sonar
        -Dsonar.host.url=https://sonarcloud.io
        -Dsonar.organization=bonigarcia-github
        -Dsonar.projectKey=io.github.bonigarcia:selenium-jupiter
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1

Use WDM_GITHUBTOKEN env (available as of WebDriverManager 5.0.0)
Use WDM_GITHUBTOKEN env (available as of WebDriverManager 5.0.0)
