summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2024-06-17 15:28:37 +0200
committerAlbin <albin@mullvad.net>2024-06-17 15:28:37 +0200
commit55e2277abc4092413f4af01e0c6587aee1138ff4 (patch)
tree6aa796fc71ee54bb5048250032a0d2ad992c3455
parent4204b0facd9e9eab031b006e613c225082af73e9 (diff)
parentbd19baca13ab86888bcfb2a2bd6710bb4a41f7d6 (diff)
downloadmullvadvpn-55e2277abc4092413f4af01e0c6587aee1138ff4.tar.xz
mullvadvpn-55e2277abc4092413f4af01e0c6587aee1138ff4.zip
Merge branch 'add-action-to-ensure-clean-lockfile-droid-669'
-rw-r--r--.github/workflows/android-audit.yml31
-rwxr-xr-xandroid/scripts/update-lockfile.sh6
2 files changed, 32 insertions, 5 deletions
diff --git a/.github/workflows/android-audit.yml b/.github/workflows/android-audit.yml
index 2945273efc..e40111b469 100644
--- a/.github/workflows/android-audit.yml
+++ b/.github/workflows/android-audit.yml
@@ -7,6 +7,7 @@ on:
- android/gradle/verification-metadata.xml
- android/config/dependency-check-suppression.xml
- android/test/test-suppression.xml
+ - android/scripts/update-lockfile.sh
schedule:
# At 06:20 UTC every day.
# Notifications for scheduled workflows are sent to the user who last modified the cron
@@ -59,3 +60,33 @@ jobs:
- name: Run gradle audit task
run: android/gradlew -p android dependencyCheckAnalyze
+
+ ensure-clean-lockfile:
+ needs: prepare
+ name: Ensure clean lockfile
+ runs-on: ubuntu-latest
+ container:
+ image: ${{ needs.prepare.outputs.container_image }}
+ steps:
+ # Fix for HOME path overridden by GH runners when building in containers, see:
+ # https://github.com/actions/runner/issues/863
+ - name: Fix HOME path
+ run: echo "HOME=/root" >> $GITHUB_ENV
+
+ - name: Set locale
+ run: echo "LC_ALL=C.UTF-8" >> $GITHUB_ENV
+
+ - uses: actions/checkout@v3
+
+ - name: Fix git dir
+ run: git config --global --add safe.directory $(pwd)
+
+ # Needed until we improve the build system.
+ - name: Create dummy jni dir
+ run: mkdir -p android/app/build/extraJni
+
+ - name: Re-generate lockfile
+ run: android/scripts/update-lockfile.sh
+
+ - name: Ensure no changes
+ run: git diff --exit-code
diff --git a/android/scripts/update-lockfile.sh b/android/scripts/update-lockfile.sh
index 3afa0c8606..594bed5fbe 100755
--- a/android/scripts/update-lockfile.sh
+++ b/android/scripts/update-lockfile.sh
@@ -12,8 +12,4 @@ echo "Removing old components..."
sed -i '/<components>/,/<\/components>/d' ../gradle/verification-metadata.xml
echo "Generating new components..."
-android_container_image_name=$(cat "../../building/android-container-image.txt")
-podman run --rm -it \
- -v ../..:/build:Z \
- "$android_container_image_name" \
- bash -c 'android/gradlew -q -p android -M sha256 assemble compileDebugUnitTestKotlin assembleAndroidTest lint'
+../gradlew -q -p .. -M sha256 assemble compileDebugUnitTestKotlin assembleAndroidTest lint