From 0093d9d2ac422bbc77763ca9d341299964cb7ddb Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Thu, 16 May 2024 13:25:49 +0200 Subject: [PATCH] Fixed actions --- .github/workflows/audit.yml | 29 ---- .github/workflows/build-and-deploy-site.yaml | 44 ++++++ .github/workflows/clippy.yml | 33 ----- .github/workflows/format.yml | 28 ---- .github/workflows/test.yml | 36 ++--- docs/android-setup.md | 133 ------------------- docs/documentation/android-setup.md | 2 +- docs/documentation/getting-to-know-tauri.md | 2 +- 8 files changed, 65 insertions(+), 242 deletions(-) delete mode 100644 .github/workflows/audit.yml create mode 100644 .github/workflows/build-and-deploy-site.yaml delete mode 100644 .github/workflows/clippy.yml delete mode 100644 .github/workflows/format.yml delete mode 100644 docs/android-setup.md diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml deleted file mode 100644 index 88f777ac..00000000 --- a/.github/workflows/audit.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Audit - -on: - schedule: - - cron: '0 0 * * *' - push: - branches: - - main - paths: - - "**/Cargo.lock" - - "**/Cargo.toml" - pull_request: - branches: - - main - paths: - - "**/Cargo.lock" - - "**/Cargo.toml" - -jobs: - audit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: rustsec/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - permissions: - issues: write - checks: write diff --git a/.github/workflows/build-and-deploy-site.yaml b/.github/workflows/build-and-deploy-site.yaml new file mode 100644 index 00000000..84535a68 --- /dev/null +++ b/.github/workflows/build-and-deploy-site.yaml @@ -0,0 +1,44 @@ +name: Build and Deploy Site + +on: + push: + branches: + - main +permissions: + contents: write + +jobs: + build-and-deploy-site: + concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + + - name: Install nix + uses: cachix/install-nix-action@v25 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - uses: cachix/cachix-action@v14 + with: + name: holochain-ci + + - uses: cachix/cachix-action@v14 + with: + name: holochain-open-dev + + - uses: cachix/cachix-action@v14 + with: + name: darksoil-studio + + - name: Install and Build 🔧 + run: | + nix develop --command bash -c "pnpm -F docs build" + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.3.3 + with: + branch: gh-pages # The branch the action should deploy to. + folder: docs/.vitepress/dist # The folder the action should deploy. + diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml deleted file mode 100644 index f8be9459..00000000 --- a/.github/workflows/clippy.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Clippy - -on: - push: - branches: - - main - pull_request: - branches: - - main - - dev - -jobs: - clippy: - runs-on: ubuntu-latest - strategy: - fail-fast: false - - steps: - - uses: actions/checkout@v3 - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y webkit2gtk-4.1 - - - name: Install clippy with stable toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: clippy - - - uses: Swatinem/rust-cache@v2 - - - run: cargo clippy --manifest-path=Cargo.toml --all-targets --all-features -- -D warnings diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index 440d0059..00000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Format - -on: - push: - branches: - - main - pull_request: - branches: - - main - - dev - -jobs: - format: - runs-on: ubuntu-latest - strategy: - fail-fast: false - - steps: - - uses: actions/checkout@v3 - - - name: Install rustfmt with stable toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - - uses: Swatinem/rust-cache@v2 - - - run: cargo fmt --manifest-path=Cargo.toml --all -- --check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e8ee8ff..35b96f88 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,14 +4,11 @@ on: push: branches: - main + - develop pull_request: branches: - main - - dev - paths-ignore: - - 'webview-src/**' - - 'webview-dist/**' - - 'examples/**' + - develop jobs: build-and-test: @@ -19,23 +16,28 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install stable toolchain - uses: dtolnay/rust-toolchain@stable + + - name: Install nix + uses: cachix/install-nix-action@v25 with: - components: clippy + nix_path: nixpkgs=channel:nixos-unstable - - name: Install Linux dependencies - if: matrix.os == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install -y webkit2gtk-4.1 + - uses: cachix/cachix-action@v14 + with: + name: holochain-ci - - uses: Swatinem/rust-cache@v2 + - uses: cachix/cachix-action@v14 + with: + name: holochain-open-dev + + - uses: cachix/cachix-action@v14 + with: + name: darksoil-studio - name: Run tests - run: cargo test --manifest-path=Cargo.toml --release + run: nix flake check -L diff --git a/docs/android-setup.md b/docs/android-setup.md deleted file mode 100644 index 87f1698f..00000000 --- a/docs/android-setup.md +++ /dev/null @@ -1,133 +0,0 @@ -# Android Setup - -> [!NOTE] -> This guide assumes that you have already gone through either [how to create an executable hApp](./how-to-create-an-executable-happ.md) or [how to create a holochain runtime](./how-to-create-a-holochain-runtime.md). - -1. In the root folder of your repository, run: - -::: code-group -```bash [npm] -npm run tauri android init -``` - -```bash [yarn] -yarn tauri android init -``` - -```bash [pnpm] -pnpm tauri android init -``` -::: - -This should initialize all the necessary android files for your app. - -2. Go in the `src-tauri/gen/android/app/build.gradle.kts` that was generated in the previous step, and set the "usesCleartextTraffic" to true: - -```kotlin -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("rust") -} - -android { - compileSdk = 33 - namespace = "com.tauri.tauri_app" - defaultConfig { - manifestPlaceholders["usesCleartextTraffic"] = "false" // [!code --] - manifestPlaceholders["usesCleartextTraffic"] = "true" // [!code ++] - applicationId = "com.tauri.tauri_app" - minSdk = 24 - targetSdk = 33 - versionCode = 1 - versionName = "1.0" - } - - buildTypes { - getByName("debug") { - manifestPlaceholders["usesCleartextTraffic"] = "true" - isDebuggable = true - isJniDebuggable = true - isMinifyEnabled = false - packaging { - jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so") - jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so") - jniLibs.keepDebugSymbols.add("*/x86/*.so") - jniLibs.keepDebugSymbols.add("*/x86_64/*.so") - } - } - getByName("release") { - signingConfig = signingConfigs.getByName("release") - isMinifyEnabled = true - proguardFiles( - *fileTree(".") { include("**/*.pro") } - .plus(getDefaultProguardFile("proguard-android-optimize.txt")) - .toList().toTypedArray() - ) - } - } - kotlinOptions { - jvmTarget = "1.8" - } -} - -rust { - rootDirRel = "../../../" -} - -dependencies { - implementation("androidx.webkit:webkit:1.6.1") - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("com.google.android.material:material:1.8.0") - testImplementation("junit:junit:4.13.2") - androidTestImplementation("androidx.test.ext:junit:1.1.4") - androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0") -} - -apply(from = "tauri.build.gradle.kts") -``` - -3. In your Android device, enable the [developer options](https://developer.android.com/studio/debug/dev-options). - -4. After you have enabled the developer options, [enable USB debbuging](https://developer.android.com/studio/debug/dev-options#Enable-debugging). - -5. Connect your Android device to your computer with a USB cable, and confirm in your Android device that you allow USB debugging from this computer. - -6. In the root folder of your repository, run: - -```bash -nix develop .#androidDev -``` - -This is a replacement command for the usual `nix develop`, which includes `Android Studio`, and all the necessary tooling that you need for Android development. Every time you want to test or build for the Android platform, you will need to enter the nix devShell this way and then your command from inside of it. - -> [!WARNING] -> The first time this is run, it will take some time. This is because nix has to download and build all the necessary Android tooling. After the first time, it will be almost instant. - -7. Inside your `androidDev` devShell, run: - -```bash -adb devices -``` - -If all the previous steps were successful, you should see your device in the list of devices. - -8. Verify that everything is working by running the app for android with: - -::: code-group -```bash [npm] -npm run tauri android dev -``` - -```bash [yarn] -yarn tauri android dev -``` - -```bash [pnpm] -pnpm tauri android dev -``` -::: - ---- - -That's it! You have completed the setup for the Android platform. diff --git a/docs/documentation/android-setup.md b/docs/documentation/android-setup.md index c04e00b9..87f1698f 100644 --- a/docs/documentation/android-setup.md +++ b/docs/documentation/android-setup.md @@ -1,7 +1,7 @@ # Android Setup > [!NOTE] -> This guide assumes that you have already gone through either [how to create an executable hApp](./happ-setup.md) or [how to create a holochain runtime](./runtime-setup.md). +> This guide assumes that you have already gone through either [how to create an executable hApp](./how-to-create-an-executable-happ.md) or [how to create a holochain runtime](./how-to-create-a-holochain-runtime.md). 1. In the root folder of your repository, run: diff --git a/docs/documentation/getting-to-know-tauri.md b/docs/documentation/getting-to-know-tauri.md index db077168..bfee223c 100644 --- a/docs/documentation/getting-to-know-tauri.md +++ b/docs/documentation/getting-to-know-tauri.md @@ -81,7 +81,7 @@ After the initial set up and scaffolding, our tauri app can only be built for de ### Android Setup -Continue to the [Android setup](./android-setup.md). +Continue to the [Android setup](./android-setup). ### iOS Setup