Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Combine native build and lint jobs

Manav Rathi8d66f0d0eb38
diff --git a/.github/checks/rust-ci-paths/check.mjs b/.github/checks/rust-ci-paths/check.mjs
index 26c171f5cb..844e3eb54e 100644
--- a/.github/checks/rust-ci-paths/check.mjs
+++ b/.github/checks/rust-ci-paths/check.mjs
@@ -7,9 +7,8 @@ const pathsFile = ".github/scripts/ci/paths.json";
const workflows = readJSON(resolve(root, pathsFile));
const bindings = {
"android-lint": "uniffi",
+ "apple-lint": "uniffi",
"desktop-lint": "napi",
- "ensu-android-build": "uniffi",
- "ensu-ios-build": "uniffi",
"mobile-lint": "frb",
};
const { packages } = JSON.parse(
diff --git a/.github/scripts/ci/paths.json b/.github/scripts/ci/paths.json
index e1b2d4cb3e..5cfa80ac9a 100644
--- a/.github/scripts/ci/paths.json
+++ b/.github/scripts/ci/paths.json
@@ -15,7 +15,22 @@
"rust/crates/image/**",
"rust/tools/codegen/**"
],
- "apple-lint": [".github/workflows/apple-lint.yml", "apple/**"],
+ "apple-lint": [
+ ".github/actions/restore-rust-target/**",
+ ".github/workflows/apple-lint.yml",
+ "apple/**",
+ "rust/.cargo/config.toml",
+ "rust/Cargo.lock",
+ "rust/Cargo.toml",
+ "rust/bindings/uniffi/**",
+ "rust/crates/assets/**",
+ "rust/crates/cast/**",
+ "rust/crates/core/**",
+ "rust/crates/ensu/**",
+ "rust/crates/ensu-crypto/**",
+ "rust/crates/image/**",
+ "rust/tools/codegen/**"
+ ],
"dependency-review": [
"**/Cargo.lock",
"**/Cargo.toml",
@@ -45,45 +60,6 @@
"rust/tools/codegen/**"
],
"docs-verify-build": [".github/workflows/docs-verify-build.yml", "docs/**"],
- "ensu-android-build": [
- ".github/actions/restore-rust-target/**",
- ".github/workflows/ensu-android-build.yml",
- "android/build.gradle.kts",
- "android/settings.gradle.kts",
- "android/gradle.properties",
- "android/gradle/**",
- "android/gradlew",
- "android/gradlew.bat",
- "android/apps/ensu/**",
- "rust/.cargo/config.toml",
- "rust/Cargo.lock",
- "rust/Cargo.toml",
- "rust/bindings/uniffi/**",
- "rust/crates/assets/**",
- "rust/crates/cast/**",
- "rust/crates/core/**",
- "rust/crates/ensu/**",
- "rust/crates/ensu-crypto/**",
- "rust/crates/image/**",
- "rust/tools/codegen/**"
- ],
- "ensu-ios-build": [
- ".github/actions/restore-rust-target/**",
- ".github/workflows/ensu-ios-build.yml",
- "apple/apps/ensu/**",
- "apple/packages/EnteOnnxRuntime/**",
- "rust/.cargo/config.toml",
- "rust/Cargo.lock",
- "rust/Cargo.toml",
- "rust/bindings/uniffi/**",
- "rust/crates/assets/**",
- "rust/crates/cast/**",
- "rust/crates/core/**",
- "rust/crates/ensu/**",
- "rust/crates/ensu-crypto/**",
- "rust/crates/image/**",
- "rust/tools/codegen/**"
- ],
"infra-lint-staff": [
".github/workflows/infra-lint-staff.yml",
"infra/staff/**"
diff --git a/.github/scripts/ci/test.mjs b/.github/scripts/ci/test.mjs
index 0368a18d13..cfb8bebeac 100644
--- a/.github/scripts/ci/test.mjs
+++ b/.github/scripts/ci/test.mjs
@@ -32,7 +32,7 @@ test("shared Android build inputs select Ensu", (t) => {
"android/gradlew",
"android/gradlew.bat",
]) {
- assert.ok(select(t, [file]).includes("ensu-android-build"), file);
+ assert.ok(select(t, [file]).includes("android-lint"), file);
}
});
@@ -44,8 +44,7 @@ test("shared build inputs select their consumers", (t) => {
]);
assert.deepEqual(select(t, ["rust/crates/core/src/lib.rs"]), [
"android-lint",
- "ensu-android-build",
- "ensu-ios-build",
+ "apple-lint",
"mobile-lint",
"repo-lint",
"rust-cli-test",
diff --git a/.github/workflows/android-lint.yml b/.github/workflows/android-lint.yml
index b78c7eab15..08aeebc356 100644
--- a/.github/workflows/android-lint.yml
+++ b/.github/workflows/android-lint.yml
@@ -42,3 +42,7 @@ jobs:
~/.gradle/wrapper
- run: ./android/scripts/lint.sh
+
+ - name: Build Ensu
+ working-directory: android
+ run: ./gradlew --build-cache :ensu:app:assembleDebug
diff --git a/.github/workflows/apple-lint.yml b/.github/workflows/apple-lint.yml
index 0735bc23fc..a540b5130e 100644
--- a/.github/workflows/apple-lint.yml
+++ b/.github/workflows/apple-lint.yml
@@ -13,4 +13,25 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
+
+ - name: Restore Rust cache
+ uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
+ with:
+ workspaces: rust
+ shared-key: ensu-ios
+ cache-targets: false
+ save-if: false
+
+ - name: Restore Rust target
+ uses: ./.github/actions/restore-rust-target
+ with:
+ shared-key: ensu-ios
+
+ - run: cargo codegen native
+ working-directory: rust
+
- run: apple/scripts/lint.sh
+
+ - name: Build and test Ensu
+ working-directory: apple/apps/ensu
+ run: xcodebuild test -scheme Ensu -destination 'platform=iOS Simulator,name=iPhone 17'
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 093738545d..a3a24e06f0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -49,16 +49,6 @@ jobs:
if: ${{ contains(fromJSON(needs.select.outputs.jobs), 'docs-verify-build') }}
uses: ./.github/workflows/docs-verify-build.yml
- ensu-android-build:
- needs: select
- if: ${{ contains(fromJSON(needs.select.outputs.jobs), 'ensu-android-build') }}
- uses: ./.github/workflows/ensu-android-build.yml
-
- ensu-ios-build:
- needs: select
- if: ${{ contains(fromJSON(needs.select.outputs.jobs), 'ensu-ios-build') }}
- uses: ./.github/workflows/ensu-ios-build.yml
-
infra-lint-staff:
needs: select
if: ${{ contains(fromJSON(needs.select.outputs.jobs), 'infra-lint-staff') }}
@@ -114,8 +104,6 @@ jobs:
- dependency-review
- desktop-lint
- docs-verify-build
- - ensu-android-build
- - ensu-ios-build
- infra-lint-staff
- mobile-lint
- mobile-podfile-lock
diff --git a/.github/workflows/ensu-android-build.yml b/.github/workflows/ensu-android-build.yml
deleted file mode 100644
index b2d090c47d..0000000000
--- a/.github/workflows/ensu-android-build.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-name: "Build (Ensu Android)"
-
-on:
- workflow_call:
-
-permissions:
- contents: read
-
-jobs:
- build:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
-
- # Restore-only; primed on main by warm-caches.yml.
- - name: Restore Rust cache
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- with:
- workspaces: rust
- shared-key: photos-desktop-ensu-android
- cache-targets: false
- save-if: false
-
- - name: Restore Rust target
- uses: ./.github/actions/restore-rust-target
- with:
- shared-key: photos-desktop-ensu-android
-
- # cargo codegen native enables llama.cpp's Vulkan backend on Linux.
- - name: Install Vulkan build dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y libvulkan-dev glslc
-
- - run: cargo codegen native
- working-directory: rust
-
- - name: Restore Gradle cache
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
- with:
- key: gradle-${{ github.sha }}
- restore-keys: gradle-
- path: |
- ~/.gradle/caches
- ~/.gradle/wrapper
-
- - name: Build Ensu
- working-directory: android
- run: ./gradlew --build-cache :ensu:app:assembleDebug
diff --git a/.github/workflows/ensu-ios-build.yml b/.github/workflows/ensu-ios-build.yml
deleted file mode 100644
index 1267b40ff8..0000000000
--- a/.github/workflows/ensu-ios-build.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: "Build (Ensu iOS)"
-
-on:
- workflow_call:
-
-permissions:
- contents: read
-
-jobs:
- build-and-test:
- runs-on: macos-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
-
- # Restore-only; primed on main by warm-caches.yml.
- - name: Restore Rust cache
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- with:
- workspaces: rust
- shared-key: ensu-ios
- cache-targets: false
- save-if: false
-
- - name: Restore Rust target
- uses: ./.github/actions/restore-rust-target
- with:
- shared-key: ensu-ios
-
- - run: cargo codegen native
- working-directory: rust
-
- # PRs lack inference fixtures, so this only tests build and startup.
- - name: Build and test Ensu
- working-directory: apple/apps/ensu
- run: xcodebuild test -scheme Ensu -destination 'platform=iOS Simulator,name=iPhone 17'
diff --git a/.github/workflows/warm-caches.yml b/.github/workflows/warm-caches.yml
index 78bdaa4760..ba5a05df13 100644
--- a/.github/workflows/warm-caches.yml
+++ b/.github/workflows/warm-caches.yml
@@ -255,7 +255,7 @@ jobs:
path: rust/target
photos-desktop-ensu-android:
- # For desktop-lint.yml, android-lint.yml and ensu-android-build.yml.
+ # For desktop-lint.yml and android-lint.yml.
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -320,7 +320,7 @@ jobs:
path: rust/target
ensu-ios:
- # For ensu-ios-build.yml.
+ # For apple-lint.yml.
runs-on: macos-latest
steps:
- name: Checkout