Merge branch 'vector-im:develop' into develop

This commit is contained in:
hanthor 2022-05-09 10:12:09 -04:00 committed by GitHub
commit f3b912a8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 129 additions and 49 deletions

View File

@ -10,6 +10,8 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "weekly" interval: "weekly"
reviewers:
- "vector-im/element-android-reviewers"
ignore: ignore:
- dependency-name: "*github-script*" - dependency-name: "*github-script*"
# Updates for Gradle dependencies used in the app # Updates for Gradle dependencies used in the app
@ -19,6 +21,6 @@ updates:
interval: "daily" interval: "daily"
open-pull-requests-limit: 200 open-pull-requests-limit: 200
reviewers: reviewers:
- "bmarty" - "vector-im/element-android-reviewers"
ignore: ignore:
- dependency-name: com.google.zxing:core - dependency-name: com.google.zxing:core

View File

@ -1,28 +1,43 @@
name: Nightly Tests name: Integration Tests
# This runs for all closed pull requests against main, including those closed without merge.
# Further filtering occurs in 'should-i-run'
on: on:
push: pull-request:
branches: [ release/* ] types: [closed]
schedule: branches: [develop]
# At 20:00 every day UTC
- cron: '0 20 * * *'
workflow_dispatch:
# Enrich gradle.properties for CI/CD # Enrich gradle.properties for CI/CD
env: env:
CI_GRADLE_ARG_PROPERTIES: > CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx4g -Porg.gradle.jvmargs=-Xmx4g
-Porg.gradle.parallel=false -Porg.gradle.parallel=false
jobs: jobs:
# More info on should-i-run:
# If this fails to run (the IF doesn't complete) then the needs will not be satisfied for any of the
# other jobs below, so none will run.
# except for the notification job at the bottom which will run all the time, unless should-i-run isn't
# successful, or all the other jobs have succeeded
should-i-run:
name: Check if PR is suitable for analysis
runs-on: ubuntu-latest
if: github.event.merged # Additionally require PR to have been completely merged.
steps:
- run: echo "Run those tests!" # no-op success
# Run Android Tests # Run Android Tests
integration-tests: integration-tests:
name: Matrix SDK - Running Integration Tests name: Matrix SDK - Running Integration Tests
needs: should-i-run
runs-on: macos-latest runs-on: macos-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
api-level: [ 28 ] api-level: [ 28 ]
# No concurrency required, runs every time on a schedule.
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1 - uses: gradle/wrapper-validation-action@v1
@ -43,11 +58,12 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-gradle- ${{ runner.os }}-gradle-
- name: Start synapse server - name: Start synapse server
uses: michaelkaye/setup-matrix-synapse@v1.0.1 uses: michaelkaye/setup-matrix-synapse@v1.0.3
with: with:
uploadLogs: true uploadLogs: true
httpPort: 8080 httpPort: 8080
disableRateLimiting: true disableRateLimiting: true
public_baseurl: "http://10.0.2.2:8080/"
# package: org.matrix.android.sdk.session # package: org.matrix.android.sdk.session
- name: Run integration tests for Matrix SDK [org.matrix.android.sdk.session] API[${{ matrix.api-level }}] - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.session] API[${{ matrix.api-level }}]
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
@ -209,6 +225,7 @@ jobs:
ui-tests: ui-tests:
name: UI Tests (Synapse) name: UI Tests (Synapse)
needs: should-i-run
runs-on: macos-latest runs-on: macos-latest
strategy: strategy:
fail-fast: false fail-fast: false
@ -230,11 +247,12 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-gradle- ${{ runner.os }}-gradle-
- name: Start synapse server - name: Start synapse server
uses: michaelkaye/setup-matrix-synapse@v1.0.1 uses: michaelkaye/setup-matrix-synapse@v1.0.3
with: with:
uploadLogs: true uploadLogs: true
httpPort: 8080 httpPort: 8080
disableRateLimiting: true disableRateLimiting: true
public_baseurl: "http://10.0.2.2:8080/"
- uses: actions/setup-java@v3 - uses: actions/setup-java@v3
with: with:
distribution: 'adopt' distribution: 'adopt'
@ -266,6 +284,7 @@ jobs:
codecov-units: codecov-units:
name: Unit tests with code coverage name: Unit tests with code coverage
needs: should-i-run
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -290,49 +309,21 @@ jobs:
path: | path: |
build/reports/jacoco/allCodeCoverageReport/allCodeCoverageReport.xml build/reports/jacoco/allCodeCoverageReport/allCodeCoverageReport.xml
sonarqube: # Notify the channel about delayed failures
name: Sonarqube upload
runs-on: macos-latest
if: always() && github.event_name == 'schedule'
needs:
- codecov-units
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/download-artifact@v3
with:
name: codecov-xml # will restore to allCodeCoverageReport.xml by default; we restore to the same location in following tasks
- run: mkdir -p build/reports/jacoco/allCodeCoverageReport/
- run: mv allCodeCoverageReport.xml build/reports/jacoco/allCodeCoverageReport/
- run: ./gradlew sonarqube $CI_GRADLE_ARG_PROPERTIES
env:
ORG_GRADLE_PROJECT_SONAR_LOGIN: ${{ secrets.SONAR_TOKEN }}
# Notify the channel about scheduled runs, or pushes to the release branches, do not notify for manually triggered runs
notify: notify:
name: Notify matrix name: Notify matrix
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- should-i-run
- integration-tests - integration-tests
- ui-tests - ui-tests
- sonarqube - codecov-units
if: always() && github.event_name != 'workflow_dispatch' if: always() && needs.should-i-run.status == "success" && (needs.codecov-units.status != "success" || needs.ui-tests.status != "success" || needs.integration-tests.status != "success")
# No concurrency required, runs every time on a schedule. # No concurrency required, runs every time on a schedule.
steps: steps:
- uses: michaelkaye/matrix-hookshot-action@v1.0.0 - uses: michaelkaye/matrix-hookshot-action@v1.0.0
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
hookshot_url: ${{ secrets.ELEMENT_ANDROID_HOOKSHOT_URL }} hookshot_url: ${{ secrets.ELEMENT_ANDROID_HOOKSHOT_URL }}
text_template: "{{#if '${{ github.event_name }}' == 'schedule' }}Nightly test run{{else}}Test run (on ${{ github.ref }}){{/if }}: {{#each job_statuses }}{{#with this }}{{#if completed }} {{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}" text_template: "Post-merge validation of ${{ github.head_ref }} into ${{ github.base_ref }} by ${{ github.event.merged_by }} failed: {{#each job_statuses }}{{#with this }}{{#if completed }} {{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}"
html_template: "{{#if '${{ github.event_name }}' == 'schedule' }}Nightly test run{{else}}Test run (on ${{ github.ref }}){{/if }}: {{#each job_statuses }}{{#with this }}{{#if completed }}<br />{{icon conclusion}} {{name}} <font color='{{color conclusion}}'>{{conclusion}} at {{completed_at}} <a href=\"{{html_url}}\">[details]</a></font>{{/if}}{{/with}}{{/each}}" html_template: "Post-merge validation of ${{ github.head_ref }} into ${{ github.base_ref }} by ${{ github.event..merged_by }} failed: {{#each job_statuses }}{{#with this }}{{#if completed }}<br />{{icon conclusion}} {{name}} <font color='{{color conclusion}}'>{{conclusion}} at {{completed_at}} <a href=\"{{html_url}}\">[details]</a></font>{{/if}}{{/with}}{{/each}}"

81
.github/workflows/sonarqube.yml vendored Normal file
View File

@ -0,0 +1,81 @@
name: Sonarqube nightly
on:
schedule:
- cron: '0 20 * * *'
# Enrich gradle.properties for CI/CD
env:
CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx4g
-Porg.gradle.parallel=false
jobs:
codecov-units:
name: Unit tests with code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- run: ./gradlew allCodeCoverageReport $CI_GRADLE_ARG_PROPERTIES
- name: Upload Codecov data
uses: actions/upload-artifact@v3
if: always()
with:
name: codecov-xml
path: |
build/reports/jacoco/allCodeCoverageReport/allCodeCoverageReport.xml
sonarqube:
name: Sonarqube upload
runs-on: ubuntu-latest
needs:
- codecov-units
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/download-artifact@v3
with:
name: codecov-xml # will restore to allCodeCoverageReport.xml by default; we restore to the same location in following tasks
- run: mkdir -p build/reports/jacoco/allCodeCoverageReport/
- run: mv allCodeCoverageReport.xml build/reports/jacoco/allCodeCoverageReport/
- run: ./gradlew sonarqube $CI_GRADLE_ARG_PROPERTIES
env:
ORG_GRADLE_PROJECT_SONAR_LOGIN: ${{ secrets.SONAR_TOKEN }}
# Notify the channel about sonarqube failures
notify:
name: Notify matrix
runs-on: ubuntu-latest
needs:
- sonarqube
- codecov-units
if: always() && (needs.sonarqube.result != "success" || needs.codecov-units.result != "success")
steps:
- uses: michaelkaye/matrix-hookshot-action@v1.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
hookshot_url: ${{ secrets.ELEMENT_ANDROID_HOOKSHOT_URL }}
text_template: "Sonarqube run (on ${{ github.ref }}): {{#each job_statuses }}{{#with this }}{{#if completed }} {{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}"
html_template: "Sonarqube run (on ${{ github.ref }}): {{#each job_statuses }}{{#with this }}{{#if completed }}<br />{{icon conclusion}} {{name}} <font color='{{color conclusion}}'>{{conclusion}} at {{completed_at}} <a href=\"{{html_url}}\">[details]</a></font>{{/if}}{{/with}}{{/each}}"

View File

@ -47,7 +47,8 @@ allprojects {
apply plugin: "org.jlleitschuh.gradle.ktlint" apply plugin: "org.jlleitschuh.gradle.ktlint"
repositories { repositories {
mavenCentral { maven {
url 'https://repo1.maven.org/maven2'
content { content {
groups.mavenCentral.regex.each { includeGroupByRegex it } groups.mavenCentral.regex.each { includeGroupByRegex it }
groups.mavenCentral.group.each { includeGroup it } groups.mavenCentral.group.each { includeGroup it }

View File

@ -177,3 +177,5 @@ class SettingsAdvancedRobot {
} }
} }
``` ```

View File

@ -7,7 +7,7 @@ apply plugin: 'com.jakewharton.butterknife'
buildscript { buildscript {
repositories { repositories {
google() google()
mavenCentral() maven { url 'https://repo1.maven.org/maven2' }
} }
dependencies { dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3' classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'

View File

@ -7,7 +7,7 @@ apply plugin: "org.jetbrains.dokka"
buildscript { buildscript {
repositories { repositories {
mavenCentral() maven { url 'https://repo1.maven.org/maven2' }
} }
dependencies { dependencies {
classpath "io.realm:realm-gradle-plugin:10.9.0" classpath "io.realm:realm-gradle-plugin:10.9.0"

View File

@ -58,6 +58,9 @@ items = [
# Need token , ["Capability", baseUrl + "_matrix/client/r0/capabilities", True] # Need token , ["Capability", baseUrl + "_matrix/client/r0/capabilities", True]
# Need token , ["Media config", baseUrl + "_matrix/media/r0/config", True] # Need token , ["Media config", baseUrl + "_matrix/media/r0/config", True]
# Need token , ["Turn", baseUrl + "_matrix/client/r0/voip/turnServer", True] # Need token , ["Turn", baseUrl + "_matrix/client/r0/voip/turnServer", True]
# Only for Synapse
, ["Synapse version", baseUrl + "_synapse/admin/v1/server_version", True]
] ]
for item in items: for item in items: