Skip to content

Bump actions/checkout from 4.2.0 to 4.2.2 #89

Bump actions/checkout from 4.2.0 to 4.2.2

Bump actions/checkout from 4.2.0 to 4.2.2 #89

Workflow file for this run

# This workflow checks if the project can be built correctly and runs its unit tests and linter
# After the tests have run it prints a report in the logs and uploads a report as workflow artifact
# This workflow only runs if a Pull Request is (re-)opened and it is not a draft
# or after a push to develop or the default branch
# For more information about best practices, see:
# https://grandcentrix.atlassian.net/wiki/spaces/TENG/pages/31180230199/GitHub+Actions+Best+Practices
name: Pull Request
on:
pull_request:
types: [ opened, reopened, ready_for_review, synchronize ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build all variants
if: github.event_name == 'push' || !github.event.pull_request.draft
runs-on: ubuntu-latest
steps:
- name: Checkout project files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK 17
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0
with:
distribution: 'temurin'
java-version: 17
- name: Set up gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 #v4.1.0
- name: Build all variants
run: ./gradlew assemble
env:
GITHUB_PAT: ${{ secrets.PACKAGES_READ_TOKEN }}
timeout-minutes: 10
test:
name: Run Unit Tests & Lint
if: github.event_name == 'push' || !github.event.pull_request.draft
runs-on: ubuntu-latest
steps:
- name: Checkout project files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK 17
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0
with:
distribution: 'temurin'
java-version: 17
- name: Set up gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 #v4.1.0
- name: Compile tests
run: ./gradlew compileDebugUnitTests
env:
GITHUB_PAT: ${{ secrets.PACKAGES_READ_TOKEN }}
timeout-minutes: 10
- name: Run tests
run: ./gradlew testDebugUnitTest --continue
env:
GITHUB_PAT: ${{ secrets.PACKAGES_READ_TOKEN }}
continue-on-error: true
timeout-minutes: 10
- name: Annotate PR with JUnit Report
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4.3.1
with:
report_paths: '**/build/test-results/**/TEST-*.xml'
token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run android lint
run: ./gradlew lint
continue-on-error: true
timeout-minutes: 5
- name: Run kotlin lint
run: ./gradlew detektAll
continue-on-error: true
timeout-minutes: 5
# Setup Ruby to allow for caching of danger install artifacts
- name: Setup Ruby
if: always() # always run even if the previous step fails
uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1.194.0
with:
ruby-version: '3.1.0'
bundler-cache: true
- name: Install Danger
if: always() # always run even if the previous step fails
run: |
# install danger and its dependencies using bundler
gem install danger
- name: Run Danger
if: always() # always run even if the previous step fails
run: |
# execute danger for this PR
bundle exec danger --dangerfile=Dangerfile --danger_id=danger-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}