Open petrvecera opened 7 months ago
Lol I completely forgot about the Hacktoberfest thing, this tag has inspired me to register for it 😂 - mind if I tackle this one next?
Sure! :) Ideally we would add this before the build https://github.com/cohstats/coh3-stats-desktop-app/blob/master/.github/workflows/tests.yaml#L84 because the build will fail in forks due to missing dependencies.
Btw @HeyZoos I am not sure if you are familiar with Rust - I have personally done only stuff with Copilot in it :D But in our CI/CD tests when we run the tests, I don't understand why it Compiles all the dependencies again when it compiled them already before in the build step :/
https://github.com/cohstats/coh3-stats-desktop-app/actions/runs/11159161292/job/31016994798
Also I am not sure about this error:
Updating git repository `[https://github.com/tauri-apps/plugins-workspace`](https://github.com/tauri-apps/plugins-workspace%60)
error: invalid character `{` in package name: `tauri-plugin-{{name}}`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
--> C:\Users\runneradmin\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\cea1d4f\shared\template\Cargo.toml:2:8
|
2 | name = "tauri-plugin-{{name}}"
| ^^^^^^^^^^^^^^^^^^^^^^^
|
This is just bonus stuff in case you would know how it can be fixed. Thanks a lot for looking into this 🙏
No worries, I'm not sure I understand the behavior either. I've gotten a bit busy with work but just wanted to let you know I'm still looking into this. 👍
Hey so unfortunately it seems like the checks need to happen after the build.
Compiling coh3-stats-desktop-app v1.5.3 (D:\a\coh3-stats-desktop-app\coh3-stats-desktop-app\src-tauri)
error: proc macro panicked
--> src/main.rs:76:14
|
76 | .run(tauri::generate_context!())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: The `distDir` configuration is set to `"../dist"` but this path doesn't exist
error: could not compile `coh3-stats-desktop-app` (bin "coh3-stats-desktop-app") due to 1 previous error
Error: Process completed with exit code 1.
This distDir
issue indicates that in order to compile the Rust backend it's expecting the output of the frontend build to exist.
How do you feel about removing the updater
configuration from the tests.yaml
workflow?
In the publish.yaml
you bring it back when doing a full release when pushing a tag:
name: "publish"
on:
push:
tags:
- "*"
- name: "Full Bundle Tauri Release"
run: |
rm ./src-tauri/tauri.conf.json
mv ./src-tauri/full-bundle-tauri.conf.json ./src-tauri/tauri.conf.json
- name: "Build and release the app"
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
with:
tagName: __VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: "__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false
includeUpdaterJson: false
For the name = "tauri-plugin-{{name}}"
issue I wonder if it's because most of the tauri-plugin-*
dependencies are on the dev
branch and not against the published libraries. It looks like most of these crates have 2.0.0
versions so this might be fixed when you migrate to Tauri 2
Actually, it's transitively pulling in a template folder through one of the dependencies, this might be easy to fix
C:\Users\jesse\.cargo\git\checkouts\plugins-workspace-fd0259fcb18f51ad\cea1d4f\shared\template\Cargo.toml
Yeah setting all the tauri-plugin-*
dependencies to v1
seems to have done the trick
But in our CI/CD tests when we run the tests, I don't understand why it Compiles all the dependencies again when it compiled them already before in the build step :/
For this, I've noticed the builds are mixing the compilation modes, I wonder if that's causing cache misses. For example, these are all logs from the same build
2024-10-24T01:07:33.0986767Z [1m[32m Compiling[0m tauri-plugin-log v0.1.0 (https://github.com/tauri-apps/plugins-workspace?branch=dev#cea1d4f7)
2024-10-24T01:08:34.9747359Z [1m[32m Finished[0m `release` profile [optimized] target(s) in 3m 52s
2024-10-24T01:10:40.2872755Z [1m[32m Compiling[0m coh3-stats-desktop-app v1.5.3 (D:\a\coh3-stats-desktop-app\coh3-stats-desktop-app\src-tauri)
2024-10-24T01:10:43.2838308Z [1m[32m Finished[0m `dev` profile [unoptimized + debuginfo] target(s) in 1m 51s
2024-10-24T01:10:46.0688728Z [1m[32m Compiling[0m coh3-stats-desktop-app v1.5.3 (D:\a\coh3-stats-desktop-app\coh3-stats-desktop-app\src-tauri)
2024-10-24T01:10:49.3633437Z [1m[32m Finished[0m `dev` profile [unoptimized + debuginfo] target(s) in 3.88s
2024-10-24T01:13:13.9291127Z [1m[32m Compiling[0m rev_lines v0.3.0
2024-10-24T01:13:19.2614107Z [1m[32m Finished[0m `test` profile [unoptimized + debuginfo] target(s) in 2m 29s
2024-10-24T01:13:19.2961716Z [1m[32m Running[0m unittests src\lib.rs (target\debug\deps\coh3_stats_desktop_app-718d9e165d5639b4.exe)
2024-10-24T01:13:53.9517150Z [1m[32m Finished[0m `release` profile [optimized] target(s) in 34.20s
2024-10-24T01:13:53.9737040Z [1m[32m Installing[0m C:\Users\runneradmin/.cargo\bin\tauri-driver.exe
2024-10-24T01:13:53.9744019Z [1m[32m Installed[0m package `tauri-driver v2.0.1` (executable `tauri-driver.exe`)
I'd recommend adding check, fmt, and clippy here as well for some general linting of the Rust code. There's an example of the setup here: https://github.com/ryantaylor/vault/blob/master/.github/workflows/checks.yml