name: CI

on: [push, pull_request]

jobs:

  test_os:
    name: OS ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Setup Java
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Test
        run: ./mvnw -V --no-transfer-progress clean verify javadoc:javadoc

  sonar:
    name: Sonar
    runs-on: ubuntu-latest
    if: github.repository == 'joel-costigliola/assertj-core' && github.event_name == 'push' && github.ref == 'refs/heads/master'
    steps:
      - uses: actions/checkout@v2
      - name: Setup Java
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Test with Sonar
        run: >
          ./mvnw -V --no-transfer-progress clean verify javadoc:javadoc org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
          -Dsonar.host.url=https://sonarcloud.io
          -Dsonar.organization=assertj
          -Dsonar.projectKey=joel-costigliola_assertj-core
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

name: CI

on: [push, pull_request]

jobs:

  test_os:
    name: OS ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Setup Java
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Test
        run: ./mvnw -V --no-transfer-progress clean verify javadoc:javadoc

  sonar:
    name: Sonar
    runs-on: ubuntu-latest
    if: github.repository == 'joel-costigliola/assertj-core' && github.event_name == 'push' && github.ref == 'refs/heads/master'
    steps:
      - uses: actions/checkout@v2
      - name: Setup Java
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Test with Sonar
        run: >
          ./mvnw -V --no-transfer-progress clean verify javadoc:javadoc
          org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar
          -Dsonar.host.url=https://sonarcloud.io
          -Dsonar.login=${{ secrets.SONAR_TOKEN }}
          -Dsonar.organization=assertj
          -Dsonar.projectKey=joel-costigliola_assertj-core

Use Sonar token as maven property, lock down plugin version
Use Sonar token as maven property, lock down plugin version
