Skip to content

Build and Test

Build and Test #698

Workflow file for this run

name: "Build and Test"
on:
# Run daily at midnight
schedule:
- cron: "0 0 * * *"
# Allow workflow to be manually run from the GitHub UI
workflow_dispatch:
# Allow workflow to be called from other files
workflow_call:
push:
pull_request:
jobs:
unit-tests:
name: "Unit Tests"
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: "Checkout Branch"
uses: actions/checkout@v3
with:
token: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{github.head_ref}}
- name: "Install JDK 11"
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Unit Tests"
run: ./gradlew test
- name: "Print Android Unit Tests Report"
uses: asadmansr/android-test-report-action@v1.2.0
if: ${{ always() }}
- name: "Archive Unit Test Results"
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: "unit-tests-results"
path: ./**/build/reports/**
lint-checks:
name: "Lint Checks"
timeout-minutes: 15
runs-on: macos-latest
steps:
- name: "Checkout Branch"
uses: actions/checkout@v3
- name: "Install JDK 11"
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Lint"
run: ./gradlew lint
- name: "Archive Lint Test Results"
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: "lint-results"
path: ./**/build/reports/**
kotlin-lint-checks:
name: "Kotlin Lint Checks"
timeout-minutes: 15
runs-on: macos-latest
steps:
- name: "Checkout Branch"
uses: actions/checkout@v3
- name: "Install JDK 11"
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Android Core SDK Kotlin Lint"
run: ./gradlew ktlintCheck
- name: "Archive Kotlin Lint Test Results"
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: "kotlin-lint-results"
path: ./**/build/reports/**
automerge-dependabot:
name: "Save PR Number for Dependabot Automerge"
needs: [ unit-tests, lint-checks, kotlin-lint-checks ]
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-save-pr-number.yml@main