From 6270c8da8c37cd9cdd96636fc168af42edc21c0d Mon Sep 17 00:00:00 2001 From: Stefan Arentz Date: Thu, 18 Feb 2021 12:02:52 -0500 Subject: [PATCH] Workflow to build contributor PRs (#17843) --- .github/workflows/build-contributor-pr.yml | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 .github/workflows/build-contributor-pr.yml diff --git a/.github/workflows/build-contributor-pr.yml b/.github/workflows/build-contributor-pr.yml new file mode 100644 index 000000000..969873a67 --- /dev/null +++ b/.github/workflows/build-contributor-pr.yml @@ -0,0 +1,103 @@ +name: Android build PR +on: [pull_request] +jobs: + run-build: + runs-on: ubuntu-20.04 + if: github.repository != 'mozilla-mobile/fenix' + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: "Clean & Assemble Debug" + uses: eskatos/gradle-command-action@v1 + with: + wrapper-cache-enabled: true + dependencies-cache-enabled: true + configuration-cache-enabled: true + arguments: clean app:assembleDebug + + run-testDebugUnitTest: + runs-on: ubuntu-20.04 + if: github.repository != 'mozilla-mobile/fenix' + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: "Test Debug Unit Tests" + uses: eskatos/gradle-command-action@v1 + with: + wrapper-cache-enabled: true + dependencies-cache-enabled: true + configuration-cache-enabled: true + arguments: testDebugUnitTest + + run-detekt: + runs-on: ubuntu-20.04 + if: github.repository != 'mozilla-mobile/fenix' + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: "Detekt" + uses: eskatos/gradle-command-action@v1 + with: + wrapper-cache-enabled: true + dependencies-cache-enabled: true + configuration-cache-enabled: true + arguments: detekt + - name: Archive detekt results + uses: actions/upload-artifact@v2 + with: + name: detekt report + path: build/reports/detekt.html + + run-ktlint: + runs-on: ubuntu-20.04 + if: github.repository != 'mozilla-mobile/fenix' + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: "Ktlint" + uses: eskatos/gradle-command-action@v1 + with: + wrapper-cache-enabled: true + dependencies-cache-enabled: true + configuration-cache-enabled: true + arguments: ktlint + + run-lintDebug: + runs-on: ubuntu-20.04 + if: github.repository != 'mozilla-mobile/fenix' + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: "Lint Debug" + uses: eskatos/gradle-command-action@v1 + with: + wrapper-cache-enabled: true + dependencies-cache-enabled: true + configuration-cache-enabled: true + arguments: lintDebug + - name: Archive lint results + uses: actions/upload-artifact@v2 + with: + name: lintDebug report + path: app/build/reports/lint-results-debug.html +