Skip to content

Merge pull request #545 from matomo-org/dependabot/gradle/org.jetbrai… #460

Merge pull request #545 from matomo-org/dependabot/gradle/org.jetbrai…

Merge pull request #545 from matomo-org/dependabot/gradle/org.jetbrai… #460

name: PullRequest
on:
push:
branches:
- master
pull_request:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
env-job:
runs-on: ubuntu-latest
outputs:
modified-branch-name: ${{ steps.env.outputs.MODIFIED_BRANCH_NAME }}
name: Modify branch name
steps:
- name: Sets MODIFIED_BRANCH_NAME
id: env
env:
name: "${{env.BRANCH_NAME}}"
run: |
echo "MODIFIED_BRANCH_NAME=${name//\//-}" >> ${GITHUB_OUTPUT}
cat ${GITHUB_OUTPUT}
buildTest:
name: Build & Unit-Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- uses: gradle/actions/wrapper-validation@v4
- name: Build project
run: ./gradlew assembleDebug
- name: Run tests
run: ./gradlew test
- name: Jacoco
run: ./gradlew :tracker:jacocoTestReport --no-daemon
- name: Codecov
run: bash <(curl -s https://codecov.io/bash)
Check:
name: Check
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
needs:
- env-job
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Code checks
run: ./gradlew check
- name: Archive Lint report
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: Matomo-Lint-${{ needs.env-job.outputs.modified-branch-name }}
path: tracker/build/reports/lint-results.html
Espresso:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
api: [ 30 ]
abi: [ x86_64 ]
tag: [ default ]
needs:
- env-job
steps:
- name: kvm support
run: |
egrep -c '(vmx|svm)' /proc/cpuinfo
id
sudo adduser $USER kvm
sudo chown -R $USER /dev/kvm
id
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: show envs
run: |
echo ${{ needs.env-job.outputs.modified-branch-name }}
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Install Android SDK
uses: hannesa2/action-android/install-sdk@0.1.16.7
- name: Run instrumentation tests
uses: hannesa2/action-android/emulator-run-cmd@0.1.16.7
with:
cmd: ./gradlew cAT --continue
api: ${{ matrix.api }}
tag: ${{ matrix.tag }}
abi: ${{ matrix.abi }}
cmdOptions: -noaudio -no-boot-anim -no-window -metrics-collection
- name: Archive Espresso results
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: matomo-Espresso-${{ needs.env-job.outputs.modified-branch-name }}
path: |
./**/build/reports/androidTests/connected
./**/build/outputs
!./**/build/outputs/apk