From fb61e9b174c9dbab8f534b4a65758315dd887acc Mon Sep 17 00:00:00 2001 From: diversepwmeasurement Date: Wed, 20 Mar 2024 21:37:46 +0000 Subject: [PATCH] Changes for PowerAPI monitoring --- .github/workflows/ci.yml | 92 +++++++++++++++++++++++----------------- .github/workflows/rc.yml | 53 +++++++++++++---------- 2 files changed, 82 insertions(+), 63 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a95bd4bb..4eb507660 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,74 +1,86 @@ -name: CI -on: - pull_request: - branches: ['**'] concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref + }} jobs: build: - if: > - !contains(github.event.head_commit.message, '#skip-ci') - runs-on: ubuntu-latest - steps: + if: '!contains(github.event.head_commit.message, ''#skip-ci'') - - uses: maxim-lobanov/setup-android-tools@v1 + ' + runs-on: self-hosted + steps: + - continue-on-error: true + uses: maxim-lobanov/setup-android-tools@v1 with: packages: cmdline-tools;latest - - - name: Install deps + - continue-on-error: true + name: Install deps run: sudo apt-get install -y unzip diffutils - - - name: Set up JDK environment + - continue-on-error: true + name: Set up JDK environment uses: actions/setup-java@v3 with: - distribution: 'zulu' + distribution: zulu java-version: '11' - - - uses: actions/checkout@v3 + - continue-on-error: true + uses: actions/checkout@v3 with: submodules: recursive - - - run: ./gradlew clean test mbw::assembleProdnetDebug mbw::assembleBtctestnetDebug mbw::assembleBtctestnetRelease - - - uses: actions/upload-artifact@v3 + - continue-on-error: true + run: ./gradlew clean test mbw::assembleProdnetDebug mbw::assembleBtctestnetDebug + mbw::assembleBtctestnetRelease + - continue-on-error: true + uses: actions/upload-artifact@v3 with: path: mbw/build/outputs/apk/ + - continue-on-error: true + name: Check Target SDK + run: 'target_sdk=$(/usr/local/lib/android/sdk/cmdline-tools/latest/bin/apkanalyzer + manifest target-sdk mbw/build/outputs/apk/btctestnet/release/mbw-btctestnet-release.apk) - - name: Check Target SDK - run: | - target_sdk=$(/usr/local/lib/android/sdk/cmdline-tools/latest/bin/apkanalyzer manifest target-sdk mbw/build/outputs/apk/btctestnet/release/mbw-btctestnet-release.apk) echo "$target_sdk" | grep "^33$" - - run: mv mbw/build/outputs/apk /tmp/buildA + ' + - continue-on-error: true + run: mv mbw/build/outputs/apk /tmp/buildA + - continue-on-error: true + name: Reproduce build + run: 'git reset --hard HEAD - - name: Reproduce build - run: | - git reset --hard HEAD git clean -dfx + cd fiosdk_kotlin + git reset --hard HEAD + git clean -dfx + cd ../wallet-android-modularization-tools + git reset --hard HEAD + git clean -dfx + cd .. + ./gradlew clean mbw::assembleBtctestnetRelease - - name: Unzip buildA + ' + - continue-on-error: true + name: Unzip buildA run: unzip -d buildA -qq /tmp/buildA/btctestnet/release/mbw-btctestnet-release.apk - - - name: Unzip buildB + - continue-on-error: true + name: Unzip buildB run: unzip -d buildB -qq mbw/build/outputs/apk/btctestnet/release/mbw-btctestnet-release.apk - - - name: Compare builds - run: | - set -x; - diffResult=$( diff --brief --recursive buildA buildB ) && diffExactlyTheSame=true; - diffCount=$( echo "$diffResult" | grep -vcE "(META-INF|^$)" ) && diffSignificant=true; - if ((diffCount != 0)); then - exit 1; - fi + - continue-on-error: true + name: Compare builds + run: "set -x;\ndiffResult=$( diff --brief --recursive buildA buildB ) && diffExactlyTheSame=true;\n\ + diffCount=$( echo \"$diffResult\" | grep -vcE \"(META-INF|^$)\" ) && diffSignificant=true;\n\ + if ((diffCount != 0)); then\n exit 1;\nfi\n" +name: CI +on: + repository_dispatch: + types: trigger-ga___ci.yml diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 71f83ba87..bca19b9c5 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -1,39 +1,46 @@ -name: RC -on: - push: - branches: [master, ci-build-rc] concurrency: - group: ${{ github.workflow }} cancel-in-progress: true + group: ${{ github.workflow }} jobs: build: - if: > - !contains(github.event.head_commit.message, '#skip-ci') - runs-on: ubuntu-latest - steps: + if: '!contains(github.event.head_commit.message, ''#skip-ci'') - - uses: actions/checkout@v3 + ' + runs-on: self-hosted + steps: + - continue-on-error: true + uses: actions/checkout@v3 with: submodules: recursive - - - uses: docker/build-push-action@v4 + - continue-on-error: true + uses: docker/build-push-action@v4 with: - tags: mycelium_builder:latest - push: false context: ${{ github.workspace }} - - - uses: addnab/docker-run-action@v3 + push: false + tags: mycelium_builder:latest + - continue-on-error: true + uses: addnab/docker-run-action@v3 with: image: mycelium_builder:latest - options: > - --volume ${{ github.workspace }}:/app/ - --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined - run: | - mkdir /project/ + options: '--volume ${{ github.workspace }}:/app/ --device /dev/fuse --cap-add + SYS_ADMIN --security-opt apparmor:unconfined + + ' + run: 'mkdir /project/ + disorderfs --sort-dirents=yes --reverse-dirents=no /app/ /project/; + cd /project/ - ./gradlew clean test mbw::assembleProdnetRelease mbw::assembleBtctestnetRelease mbw::assembleProdnetDebug mbw::assembleBtctestnetDebug - - uses: actions/upload-artifact@v3 + ./gradlew clean test mbw::assembleProdnetRelease mbw::assembleBtctestnetRelease + mbw::assembleProdnetDebug mbw::assembleBtctestnetDebug + + ' + - continue-on-error: true + uses: actions/upload-artifact@v3 with: path: mbw/build/outputs/ +name: RC +on: + repository_dispatch: + types: trigger-ga___rc.yml