name: Urlaubsverwaltung CI

on: [push]

jobs:
  build:
    name: with jdk ${{ matrix.java }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ '11', '12' ]
    steps:
      - uses: actions/checkout@v1
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Build with Maven
        run: ./mvnw --batch-mode clean verify

  sonar:
    name: sonar analyse
    runs-on: ubuntu-latest
    needs: build
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Run SonarCloud analyse
        run: >
          ./mvnw --batch-mode clean
          org.jacoco:jacoco-maven-plugin:prepare-agent verify
          org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
          -Dsonar.host.url=https://sonarcloud.io
          -Dsonar.organization=synyx
          -Dsonar.projectKey=org.synyx:urlaubsverwaltung
          -Dsonar.javascript.lcov.reportPaths=target/js-coverage/lcov.info
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

name: Urlaubsverwaltung CI

on: [push]

jobs:
  build:
    name: with jdk ${{ matrix.java }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ '11', '12' ]
    steps:
      - uses: actions/checkout@v1
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Build with Maven
        run: ./mvnw --batch-mode clean verify

  sonar:
    name: sonar analyse
    runs-on: ubuntu-latest
    needs: build
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Run SonarCloud analyse
        run: >
          ./mvnw --batch-mode clean
          org.jacoco:jacoco-maven-plugin:prepare-agent verify
          org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
          -Dsonar.host.url=https://sonarcloud.io
          -Dsonar.organization=synyx
          -Dsonar.projectKey=org.synyx:urlaubsverwaltung
          -Dsonar.javascript.lcov.reportPaths=target/js-coverage/lcov.info
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Add github token to the sonar job
Add github token to the sonar job
