From 9fa63c7547ede8980d590a14470b2fbcea4f23c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey=20Vilas?= Date: Wed, 12 Jan 2022 17:12:11 +0100 Subject: [PATCH] Run analysis workflow in github actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Brey Vilas --- .drone.yml | 51 --------------------------------- .github/workflows/analysis.yml | 21 ++++++++++++++ scripts/analysis/findbugs-up.rb | 2 +- scripts/analysis/lint-up.rb | 2 +- 4 files changed, 23 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/analysis.yml diff --git a/.drone.yml b/.drone.yml index e390e17f70..4f9c6e80ff 100644 --- a/.drone.yml +++ b/.drone.yml @@ -163,58 +163,7 @@ trigger: event: - push - pull_request ---- -kind: pipeline -type: docker -name: analysis -steps: - - name: analysis - image: ghcr.io/nextcloud/continuous-integration-android8:2 - environment: - GIT_USERNAME: - from_secret: GIT_USERNAME - GIT_TOKEN: - from_secret: GIT_TOKEN - LOG_USERNAME: - from_secret: LOG_USERNAME - LOG_PASSWORD: - from_secret: LOG_PASSWORD - commands: - - scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0 - - export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST) - - scripts/analysis/analysis-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST - - - name: notify - image: drillster/drone-email - settings: - port: 587 - from: nextcloud-drone@kaminsky.me - recipients_only: true - username: - from_secret: EMAIL_USERNAME - password: - from_secret: EMAIL_PASSWORD - recipients: - from_secret: EMAIL_RECIPIENTS - host: - from_secret: EMAIL_HOST - when: - event: - - push - status: - - failure - branch: - - master - - stable-* - -trigger: - branch: - - master - - stable-* - event: - - push - - pull_request --- kind: pipeline type: docker diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml new file mode 100644 index 0000000000..cd53d6cfb4 --- /dev/null +++ b/.github/workflows/analysis.yml @@ -0,0 +1,21 @@ +name: "Analysis" + +on: + pull_request: + branches: [ master, stable-* ] + +jobs: + analysis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: "adopt" + java-version: 11 + - name: Run analysis wrapper + run: | + mkdir -p $HOME/.gradle + echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties + scripts/analysis/analysis-wrapper.sh ${{ secrets.GIT_USERNAME }} ${{ secrets.GIT_TOKEN }} $GITHUB_REF ${{ secrets.LOG_USERNAME }} ${{ secrets.LOG_PASSWORD }} $GITHUB_RUN_NUMBER ${{ github.event.pull_request.number }} diff --git a/scripts/analysis/findbugs-up.rb b/scripts/analysis/findbugs-up.rb index e66583ac16..4bb065daff 100644 --- a/scripts/analysis/findbugs-up.rb +++ b/scripts/analysis/findbugs-up.rb @@ -39,7 +39,7 @@ require 'open3' begin gem "xml-simple" rescue LoadError - system("gem install xml-simple") + system("gem install --user-install xml-simple") Gem.clear_paths end diff --git a/scripts/analysis/lint-up.rb b/scripts/analysis/lint-up.rb index ae3215db8d..7a9a7ed293 100644 --- a/scripts/analysis/lint-up.rb +++ b/scripts/analysis/lint-up.rb @@ -39,7 +39,7 @@ require 'open3' begin gem "xml-simple" rescue LoadError - system("gem install xml-simple") + system("gem install --user-install xml-simple") Gem.clear_paths end