Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbbaecb4 authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

Merge branch '1292-Update_with_upstream' into 'main'

[AccountManager] 1292-Update_with_upstream

See merge request !104
parents c139ab68 96763195
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
blank_issues_enabled: false
contact_links:
  - name: DAVx⁵ Community Support
    url: https://github.com/bitfireAT/davx5-ose/discussions
    about: Ask and answer questions (including feature requests and bug reports) here.
+55 −0
Original line number Diff line number Diff line
name: "CodeQL"

on:
  push:
    branches: [ "dev-ose", main-ose ]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [ "dev-ose" ]
  schedule:
    - cron: '22 10 * * 1'
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'java' ]

    steps:
    - name: Checkout repository
      uses: actions/checkout@v3
    - uses: actions/setup-java@v3
      with:
        distribution: 'temurin'
        java-version: 17
    - uses: gradle/gradle-build-action@v2

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v2
      with:
        languages: ${{ matrix.language }}

    # Autobuild attempts to build any compiled languages  (C/C++, C#, Go, or Java).
    # If this step fails, then you should remove it and run the build manually (see below)
    #- name: Autobuild
    #  uses: github/codeql-action/autobuild@v2

    - name: Build
      run: ./gradlew --no-daemon app:assembleOseDebug

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v2
      with:
        category: "/language:${{matrix.language}}"
+12 −11
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@ on:
  push:
    tags:
      - v*
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
jobs:
  build:
    name: Create release
@@ -10,21 +13,19 @@ jobs:
      contents: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/checkout@v3
      - uses: actions/setup-java@v3
        with:
          submodules: true
      - uses: actions/setup-java@v2
        with:
          distribution: 'temurin'
          java-version: 11
          cache: 'gradle'
      - uses: gradle/wrapper-validation-action@v1
          distribution: temurin
          java-version: 17
      - uses: gradle/gradle-build-action@v2

      - name: Prepare keystore
        run: echo ${{ secrets.android_keystore_base64 }} | base64 -d >$GITHUB_WORKSPACE/keystore.jks

      - name: Build signed package
        run: ./gradlew app:assembleRelease
        # --no-configuration-cache is only required for AboutLibraries (bitfireAT/davx5#263, mikepenz/AboutLibraries#857)
        # Remove it as soon as AboutLibraries is compatbile with the gradle configuration cache.
        run: ./gradlew --no-configuration-cache --no-daemon app:assembleRelease
        env:
          ANDROID_KEYSTORE: ${{ github.workspace }}/keystore.jks
          ANDROID_KEYSTORE_PASSWORD: ${{ secrets.android_keystore_password }}
@@ -32,7 +33,7 @@ jobs:
          ANDROID_KEY_PASSWORD: ${{ secrets.android_key_password }}

      - name: Create Github release
        uses: softprops/action-gh-release@v0.1.14
        uses: softprops/action-gh-release@v1
        with:
          prerelease: ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc') }}
          files: app/build/outputs/apk/ose/release/*.apk
+51 −28
Original line number Diff line number Diff line
name: Development tests
on: [push, pull_request]
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
jobs:

  test:
    name: Tests without emulator
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - uses: actions/setup-java@v2
      - uses: actions/checkout@v3
      - uses: actions/setup-java@v3
        with:
          distribution: zulu
          java-version: 11
          cache: gradle
      - uses: gradle/wrapper-validation-action@v1
          distribution: temurin
          java-version: 17
      - uses: gradle/gradle-build-action@v2

      - name: Run lint and unit tests
        run: ./gradlew app:check
@@ -27,31 +28,54 @@ jobs:

  test_on_emulator:
    name: Tests with emulator
    runs-on: privileged
    container:
      image: ghcr.io/bitfireat/docker-android-ci:main
      options: --privileged
      env:
        ANDROID_HOME: /sdk
        ANDROID_AVD_HOME: /root/.android/avd
    runs-on: ubuntu-latest-4-cores
    strategy:
      matrix:
        api-level: [ 31 ]
    steps:
      - uses: actions/checkout@v2
      - uses: actions/checkout@v3
      - uses: actions/setup-java@v3
        with:
          submodules: true
      - uses: gradle/wrapper-validation-action@v1
          distribution: temurin
          java-version: 17
      - uses: gradle/gradle-build-action@v2

      - name: Cache gradle dependencies
        uses: actions/cache@v2
      - name: Enable KVM group perms
        run: |
          echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
          sudo udevadm control --reload-rules
          sudo udevadm trigger --name-match=kvm

      - name: Cache AVD and APKs
        uses: actions/cache@v3
        id: avd-cache
        with:
          key: ${{ runner.os }}
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
            ~/.android/avd/*
            ~/.android/adb*
          key: avd-${{ matrix.api-level }}

      - name: Create AVD and generate snapshot for caching
        if: steps.avd-cache.outputs.cache-hit != 'true'
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: ${{ matrix.api-level }}
          arch: x86_64
          force-avd-creation: false
          emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          disable-animations: false
          script: echo "Generated AVD snapshot for caching."

      - name: Run tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: ${{ matrix.api-level }}
          arch: x86_64
          force-avd-creation: false
          emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          disable-animations: true
          script: ./gradlew app:connectedCheck

      - name: Start emulator
        run: start-emulator.sh
      - name: Run connected tests
        run: ./gradlew app:connectedCheck
      - name: Archive results
        if: always()
        uses: actions/upload-artifact@v2
@@ -59,4 +83,3 @@ jobs:
          name: test-results
          path: |
            app/build/reports
+2 −7
Original line number Diff line number Diff line
image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:latest"
image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:1263-Add_java_17_support"

stages:
  - update-from-upstream
@@ -19,8 +19,6 @@ cache:

build:
  stage: build
  variables:
    GIT_SUBMODULE_STRATEGY: recursive
  script:
    - ./gradlew build -x test
  artifacts:
@@ -28,7 +26,6 @@ build:
      - app/build/outputs/apk/ose/

.update-from-upstream:
  image: registry.gitlab.e.foundation/e/tools/docker-tools:latest
  stage: update-from-upstream
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_REF_NAME == $LOCAL_BRANCH'
@@ -65,8 +62,6 @@ build:
    - git checkout -b $TEMP_LATEST_TAG_BRANCH
    # merge $LOCAL_BRANCH with $TEMP_LATEST_TAG_BRANCH & push
    - git checkout $LOCAL_BRANCH
    - git submodule sync
    - git submodule update --init --recursive --force
    - git merge $TEMP_LATEST_TAG_BRANCH
    - git push origin $LOCAL_BRANCH
    # remove unwanted local branch & remote
@@ -78,7 +73,7 @@ update-default-branch:
  variables:
    LOCAL_BRANCH: main
    UPSTREAM_BRANCH: upstream/master
    UPSTREAM_DEFAULT_BRANCH: main-ose
    UPSTREAM_DEFAULT_BRANCH: release-ose
    UPSTREAM_URL: https://github.com/bitfireAT/davx5-ose.git
    TEMP_LATEST_TAG_BRANCH: latest_upstream_tag_branch

Loading