diff --git a/.github/workflows/dogfood.yml b/.github/workflows/dogfood.yml deleted file mode 100644 index e8ddc862c30..00000000000 --- a/.github/workflows/dogfood.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: dogfood merge -# This workflow is triggered on pushes to master and dogfood branches -on: - push: - branches: - - master - - 'dogfood/*' -# commenting 'delete' action, as it is triggered way too often -# delete: -# branches: -# - 'dogfood/*' - -env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_USERNAME: Dogfood build action - -jobs: - dogfood_merge: - runs-on: ubuntu-latest - name: Update dogfood branch - steps: - - name: git octopus step - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - id: dogfood - uses: SonarSource/gh-action_dogfood_merge@master - with: - dogfood-branch: 'dogfood-on-peach' - # Use the output from the `dogfood` step - - name: Get the name of the dogfood branch and its HEAD SHA1 - run: echo "The dogfood branch was `${{ steps.dogfood.outputs.dogfood-branch }}` and its HEAD SHA1 was `${{ steps.dogfood.outputs.sha1 }}`" - #slack notifications - - name: Notify success on Slack - uses: Ilshidur/action-slack@1.6.2 - env: - SLACK_OVERRIDE_MESSAGE: 'Dogfood build for `${{ steps.dogfood.outputs.sha1 }}`: *successful*' - with: - args: 'Succeed to build dogfood branch' - - name: Notify failures on Slack - uses: Ilshidur/action-slack@1.6.2 - if: failure() - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_USERNAME: Dogfood build action - SLACK_OVERRIDE_MESSAGE: 'Dogfood build for `${{ steps.dogfood.outputs.sha1 }}`: *failed*, see the logs at https://github.com/SonarSource/sonar-java/actions' - with: - args: 'Fail to build dogfood branch' - diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000000..1ed36cd5c27 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,36 @@ +name: Build +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=cloudandcloud2020_sonar-java3 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 15e036d7a7b..00000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: nightly build -# This workflow is triggered on schedule -on: - schedule: - - cron: '0 1 * * *' - -env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_USERNAME: Nightly build action - -jobs: - nightly_build: - runs-on: ubuntu-latest - name: Run a nightly build - steps: - - name: starts a build - env: - CIRRUS_TOKEN: ${{ secrets.CIRRUS_TOKEN }} - uses: SonarSource/gh-action_nightly_build@master - with: - branch: 'master' - #slack notifications - - name: Notify success on Slack - uses: Ilshidur/action-slack@1.6.2 - env: - SLACK_OVERRIDE_MESSAGE: 'Nightly build successful' - with: - args: 'Succeed to build dogfood branch' - - name: Notify failures on Slack - uses: Ilshidur/action-slack@1.6.2 - if: failure() - env: - SLACK_OVERRIDE_MESSAGE: 'Nightly build: *failed*, see the logs at https://github.com/SonarSource/sonar-java/actions' - with: - args: 'Fail to build dogfood branch' \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 880b02df300..00000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: sonar-release -# This workflow is triggered when publishing a new github release -on: - release: - types: - - published - -env: - PYTHONUNBUFFERED: 1 - -jobs: - sonar_release: - runs-on: ubuntu-latest - name: Start release process - steps: - - name: LT release - id: lt_release - with: - distribute: true - publish_to_binaries: true - attach_artifacts_to_github_release: true - run_rules_cov: true - slack_channel: team-lang-java-notifs - env: - ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} - BURGRX_USER: ${{ secrets.BURGRX_USER }} - BURGRX_PASSWORD: ${{ secrets.BURGRX_PASSWORD }} - CIRRUS_TOKEN: ${{ secrets.CIRRUS_TOKEN }} - PATH_PREFIX: ${{ secrets.BINARIES_PATH_PREFIX }} - GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} - RELEASE_SSH_USER: ${{ secrets.RELEASE_SSH_USER }} - RELEASE_SSH_KEY: ${{ secrets.RELEASE_SSH_KEY }} - SLACK_API_TOKEN: ${{secrets.SLACK_API_TOKEN }} - # Put your action repo here - uses: SonarSource/gh-action_release/main@v3 - - - name: Check outputs - if: always() - run: | - echo "${{ steps.lt_release.outputs.releasability }}" - echo "${{ steps.lt_release.outputs.release }}" - maven-central-sync: - runs-on: ubuntu-latest - needs: - - sonar_release - steps: - - name: Setup JFrog CLI - uses: jfrog/setup-jfrog-cli@v1 - - name: JFrog config - run: jfrog rt config repox --url https://repox.jfrog.io/artifactory/ --apikey $ARTIFACTORY_API_KEY --basic-auth-only - env: - ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} - - name: Get the version - id: get_version - run: | - IFS=. read major minor patch build <<< "${{ github.event.release.tag_name }}" - echo ::set-output name=build::"${build}" - - name: Create local repository directory - id: local_repo - run: echo ::set-output name=dir::"$(mktemp -d repo.XXXXXXXX)" - - name: Download Artifacts - uses: SonarSource/gh-action_release/download-build@v3 - with: - build-number: ${{ steps.get_version.outputs.build }} - local-repo-dir: ${{ steps.local_repo.outputs.dir }} - - name: Maven Central Sync - id: maven-central-sync - continue-on-error: true - uses: SonarSource/gh-action_release/maven-central-sync@v3 - with: - local-repo-dir: ${{ steps.local_repo.outputs.dir }} - env: - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - - name: Notify on failure - if: ${{ failure() || steps.maven-central-sync.outcome == 'failure' }} - uses: 8398a7/action-slack@v3 - with: - status: failure - fields: repo,author,eventName - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BUILD_WEBHOOK }} diff --git a/pom.xml b/pom.xml index 21511e70e72..e222e4e31cf 100644 --- a/pom.xml +++ b/pom.xml @@ -298,6 +298,15 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + de.thetaphi forbiddenapis @@ -349,7 +358,7 @@ java9+ - [9,) + [11,) 8 diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000000..6ac5b12fd4b --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ + + cloudandcloud2020 + https://sonarcloud.io +