From 460a7022a751a1cd02d497b50c1f9db4d3a4f349 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Date: Fri, 10 Dec 2021 12:23:32 +0100 Subject: [PATCH] Add GitHub action --- .github/workflows/build.yml | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..637c356 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,60 @@ +name: Build Artifacts + +on: pull_request + +env: + JAVA_OPTS: -Xms512m -Xmx1024m + GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dorg.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" + +jobs: + build_artifacts: + + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Restore Gradle cache + id: cache + uses: actions/cache@v2.1.7 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + ~/.gradle/yarn + ~/.gradle/nodejs + ~/.konan + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ matrix.kotlin }}-${{ matrix.jvm_target }} + restore-keys: | + ${{ runner.os }}-gradle- + + - uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' + + - name: Build and test with Gradle + run: ./gradlew build + + - name: Bundle build report + if: failure() + run: find . -type d -name 'reports' | zip -@ -r build-reports.zip + + - name: Upload build report + if: failure() + uses: actions/upload-artifact@master + with: + name: error-report + path: build-reports.zip + + - name: Bundle analysis report + run: mkdir sarif && find . -name '*.sarif' | xargs -I{} cp "{}" ./sarif/ + + - name: Upload analysis report + uses: github/codeql-action/upload-sarif@v1 + with: + # Path to SARIF file relative to the root of the repository + sarif_file: sarif