Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI #509

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c7beb02
Update CI
anstadnik May 7, 2024
8f1d797
Update build_and_test_bot.yml
anstadnik May 8, 2024
f639f42
Add flutter to workflows
anstadnik May 10, 2024
4b3335d
Merge branch 'dev' into anstadnik-patch-1
anstadnik May 10, 2024
3bf1cfd
fix
anstadnik May 10, 2024
5b34dc4
Merge pull request #510 from anstadnik/anstadnik-patch-1
anstadnik May 10, 2024
1be9439
build(deps): bump flutter_lints from 3.0.2 to 4.0.0 in /app (#511)
dependabot[bot] May 13, 2024
02703a4
build(deps): bump flutter_rust_bridge in /app (#507)
dependabot[bot] May 13, 2024
f0fdcb9
Update CI.yml
anstadnik May 14, 2024
37c6e8c
Merge pull request #516 from anstadnik/anstadnik-patch-1
anstadnik May 15, 2024
5997dba
Update CI
anstadnik May 15, 2024
3dd336d
build(deps): bump security-framework from 2.10.0 to 2.11.0 (#515)
dependabot[bot] May 15, 2024
f14d658
build(deps): bump errno from 0.3.8 to 0.3.9 (#513)
dependabot[bot] May 15, 2024
999d99e
Update CI again :)
anstadnik May 15, 2024
5a722c2
build(deps): bump serde_json from 1.0.116 to 1.0.117 (#514)
dependabot[bot] May 20, 2024
b311a38
build(deps): bump proc-macro2 from 1.0.81 to 1.0.83 (#517)
dependabot[bot] May 20, 2024
ee26680
build(deps): bump either from 1.11.0 to 1.12.0 (#521)
dependabot[bot] May 20, 2024
4499ca9
build(deps): bump thiserror from 1.0.59 to 1.0.61 (#523)
dependabot[bot] May 20, 2024
74cbd68
build(deps): bump itertools from 0.12.1 to 0.13.0 (#522)
dependabot[bot] May 20, 2024
16c0952
build(deps): bump flutter_rust_bridge from 2.0.0-dev.32 to 2.0.0-dev.…
dependabot[bot] May 20, 2024
81777bb
build(deps): bump anyhow from 1.0.82 to 1.0.86 (#524)
dependabot[bot] May 20, 2024
bd83f36
Update CI
anstadnik May 22, 2024
2005598
Update CI
anstadnik May 22, 2024
b3c11a2
--- (#525)
dependabot[bot] May 22, 2024
7b2909d
build(deps): bump flutter_platform_widgets from 6.1.0 to 7.0.0 in /ap…
dependabot[bot] May 22, 2024
fa11bf1
Enable english
anstadnik May 24, 2024
7f2594f
Fix
anstadnik May 24, 2024
6c67d1b
Update
anstadnik May 24, 2024
e10f98c
Merge branch 'dev' into english
anstadnik May 24, 2024
3eff62f
Update
anstadnik May 24, 2024
dc291c0
Merge pull request #526 from anstadnik/english
anstadnik May 24, 2024
0971987
Restart CI/CD
anstadnik May 24, 2024
3b444c7
Merge pull request #527 from anstadnik/english
anstadnik May 24, 2024
35adfc7
Download multiple languages
anstadnik May 24, 2024
18fb0e8
Merge pull request #528 from anstadnik/english
anstadnik May 24, 2024
b3dece9
Add a test
anstadnik May 24, 2024
d3e6289
Merge pull request #529 from anstadnik/english
anstadnik May 24, 2024
5149fb8
build(deps): bump flutter_rust_bridge in /app (#530)
dependabot[bot] May 27, 2024
f64f691
build(deps): bump getrandom from 0.2.14 to 0.2.15 (#535)
dependabot[bot] May 27, 2024
53fcddd
add_tests
anstadnik May 27, 2024
830d594
update_CI
anstadnik May 27, 2024
0a342e8
Merge pull request #536 from anstadnik/english
anstadnik May 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
release: ${{ github.base_ref == 'main' }}
upload-artifact: true
secrets:
SHEET_ID: ${{ vars.SHEET_ID }}
SHEET_ID: ${{ github.base_ref == 'main' && secrets.SHEET_ID_main || secrets.SHEET_ID_dev }}

build_flutter_apk:
uses: ./.github/workflows/build_flutter_apk.yml
with:
upload-artifact: true
secrets:
SHEET_ID: ${{ vars.SHEET_ID }}
SHEET_ID: ${{ github.base_ref == 'main' && secrets.SHEET_ID_main || secrets.SHEET_ID_dev }}

# It should wait untill all checks will pass
auto-merge:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/build_and_test_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ jobs:
if: inputs.release
run: curl -L "docs.google.com/spreadsheets/d/${{ secrets.SHEET_ID }}/gviz/tq?tqx=out:csv&sheet=Ukrainian" -o table.csv

- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-expand
- uses: baptiste0928/cargo-install@v2
with:
crate: flutter_rust_bridge_codegen
version: 2.0.0-dev.32
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Update bindings
run: flutter_rust_bridge_codegen generate
working-directory: app
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
RUST_LOG: info
- name: Test and build release
if: inputs.release
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_flutter_apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
with:
crate: cargo-expand
# - run: flutter_rust_bridge_codegen build && flutter build apk --release
- run: flutter build apk --release
- run: flutter_rust_bridge_codegen generate && flutter build apk --release
env:
SHEET_ID: ${{ secrets.SHEET_ID }}
- uses: actions/upload-artifact@v3
Expand Down
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,26 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "4.0.0"
flutter_platform_widgets:
dependency: "direct main"
description:
name: flutter_platform_widgets
sha256: c483c0591d845d2adb84e341a1cfb746f1a8a7aff4c72a5957772446020601f4
sha256: "1a52147c03f0265b4f64d607f05ccfce5b2390224c6d40435ebc212f23576fff"
url: "https://pub.dev"
source: hosted
version: "6.1.0"
version: "7.0.0"
flutter_rust_bridge:
dependency: "direct main"
description:
name: flutter_rust_bridge
sha256: d65dbdd271de6050d3204bab69a8ae25a291deb359403cd4f95a86055cab66c3
sha256: efb018e387c5e844095e35e9d6c6bd1610c49f25de109f4988b7c45aeca60a9a
url: "https://pub.dev"
source: hosted
version: "2.0.0-dev.32"
version: "2.0.0-dev.36"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -142,34 +142,34 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.1"
lints:
dependency: transitive
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "4.0.0"
matcher:
dependency: transitive
description:
Expand All @@ -190,10 +190,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.12.0"
nested:
dependency: transitive
description:
Expand Down Expand Up @@ -306,10 +306,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.0"
vector_math:
dependency: transitive
description:
Expand All @@ -322,10 +322,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.1"
webdriver:
dependency: transitive
description:
Expand All @@ -336,4 +336,4 @@ packages:
version: "3.0.3"
sdks:
dart: ">=3.3.4 <4.0.0"
flutter: ">=3.16.0"
flutter: ">=3.18.0-18.0.pre.54"
6 changes: 3 additions & 3 deletions app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ dependencies:
cupertino_icons: ^1.0.6
rust_lib_app:
path: rust_builder
flutter_rust_bridge: 2.0.0-dev.32
flutter_rust_bridge: 2.0.0-dev.36
provider: ^6.1.2
flutter_platform_widgets: ^6.1.0
flutter_platform_widgets: ^7.0.0

dev_dependencies:
flutter_test:
Expand All @@ -50,7 +50,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^3.0.0
flutter_lints: ^4.0.0
integration_test:
sdk: flutter

Expand Down
2 changes: 1 addition & 1 deletion bot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ teloxide = { version = "0.12", features = ["macros", "redis-storage",
"bincode-serializer", "throttle"] }
redis = { version = "0.25", features = ["tokio-comp"] }
rand = "0.8"
itertools = "0.12"
itertools = "0.13"
futures = "0.3"

anyhow = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion bot/src/bot/dialogue/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub async fn commands_handler(
dialogue: FADialogue,
) -> anyhow::Result<()> {
match cmd {
FACommands::Start => start_endpoint(bot, msg, dialogue).await,
FACommands::Start => start_endpoint(bot, msg, dialogue, Lang::default()).await,
}
}

Expand Down
22 changes: 14 additions & 8 deletions bot/src/bot/dialogue/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ use first_aid_bot_core::prelude::*;
use rand::random;
use teloxide::{requests::Requester, types::Message};

pub async fn start_endpoint(bot: FABot, msg: Message, dialogue: FADialogue) -> Result<()> {
pub async fn start_endpoint(
bot: FABot,
msg: Message,
dialogue: FADialogue,
lang: Lang,
) -> Result<()> {
if is_admin(&msg) && random::<u8>() % 50 == 0 {
easter_egg(&bot, &msg).await?;
}
let ctx = FAContext::default();
let ctx = FAContext {
lang,
..FAContext::default()
};
move_to_state(&bot, &msg, &dialogue, &*DATA.get_state(&ctx).await?, ctx).await
}

Expand All @@ -21,13 +29,11 @@ pub async fn transition_endpoint(
dialogue: FADialogue,
(lang, context): (String, Vec<String>),
) -> Result<()> {
let f = || async {
let lang = lang.as_str().try_into()?;
transition_logic(&bot, &msg, &dialogue, FAContext { lang, context }).await
};
let lang = lang.as_str().try_into()?;
let f = || async { transition_logic(&bot, &msg, &dialogue, FAContext { lang, context }).await };

if let Err(e) = f().await {
start_endpoint(bot, msg, dialogue).await?;
start_endpoint(bot, msg, dialogue, lang).await?;
bail!(e);
}
Ok(())
Expand All @@ -43,7 +49,7 @@ pub async fn broadcast_endpoint(
let _ = bot
.send_message(msg.chat.id, "WTF you are not an admin bye")
.await;
return start_endpoint(bot, msg, dialogue).await;
return start_endpoint(bot, msg, dialogue, Lang::default()).await;
}
process_broadcast(&bot, &msg, &dialogue, message).await?;
Ok(())
Expand Down
Loading
Loading