mirror of
https://github.com/babichjacob/ac-qu-ai-nt.git
synced 2025-10-02 16:57:53 -04:00
Compare commits
36 Commits
e4e2efafb9
...
ac-qu-ai-n
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1175fa22d6 | ||
![]() |
13b7053386 | ||
![]() |
972129536f | ||
![]() |
ae7de503a4 | ||
![]() |
21df8d1781 | ||
![]() |
e5707cb106 | ||
![]() |
7f450568f2 | ||
![]() |
e2bf39e2c1 | ||
![]() |
e96081486a | ||
![]() |
63ffbf9f1a | ||
![]() |
65bdf6dd04 | ||
![]() |
43682dc3d3 | ||
![]() |
c25e628aa9 | ||
![]() |
1177376450 | ||
![]() |
f37d56edba | ||
![]() |
1854dc429c | ||
![]() |
3e69d65bcc | ||
![]() |
4c04f21dcb | ||
![]() |
c0ec64f06c | ||
![]() |
70e20e2e04 | ||
![]() |
12107daf6b | ||
![]() |
839f219469 | ||
![]() |
56ad1de3d4 | ||
![]() |
30dee5efa7 | ||
![]() |
52297c7b43 | ||
![]() |
b1520ae76b | ||
![]() |
ac42b4861c | ||
![]() |
499562853c | ||
![]() |
d6922c30c5 | ||
![]() |
b5935b8ab5 | ||
![]() |
5e0a2326ca | ||
![]() |
1493425540 | ||
![]() |
576a8e99c0 | ||
![]() |
01ce1e85a8 | ||
![]() |
cd788e1ab8 | ||
![]() |
65487b2378 |
153
.github/workflows/check-and-build-and-test.yml
vendored
153
.github/workflows/check-and-build-and-test.yml
vendored
@@ -3,6 +3,14 @@ name: Check, build, and test
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
# This workflow is definitely expensive for GitHub,
|
||||
# so let's not let files that won't affect the project's ability to build and test trigger it
|
||||
paths-ignore:
|
||||
- ".github/**"
|
||||
- "**/.gitignore"
|
||||
- "**/CHANGELOG.md"
|
||||
- "**/README.md"
|
||||
- "**/LICENSE-*"
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
|
||||
@@ -10,35 +18,146 @@ env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
check-build-and-test:
|
||||
formatting:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
timeout-minutes: 2
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
- name: Install stable Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Formatting
|
||||
run: cargo fmt --check --verbose
|
||||
|
||||
check-and-build:
|
||||
strategy:
|
||||
matrix:
|
||||
supporteds:
|
||||
- runner: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
|
||||
- runner: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
|
||||
- install_prerequisite: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu
|
||||
runner: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
|
||||
- install_prerequisite: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu
|
||||
runner: ubuntu-latest
|
||||
target: aarch64-unknown-linux-musl
|
||||
|
||||
- runner: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
|
||||
- runner: ubuntu-latest
|
||||
target: x86_64-unknown-linux-musl
|
||||
|
||||
# I would like to support this but I don't know how to install the dependencies to be able to
|
||||
# - runner: windows-latest
|
||||
# target: aarch64-pc-windows-gnullvm
|
||||
|
||||
- runner: windows-latest
|
||||
target: aarch64-pc-windows-msvc
|
||||
|
||||
- runner: windows-latest
|
||||
target: x86_64-pc-windows-gnu
|
||||
|
||||
- runner: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
name: Check and build ${{ matrix.supporteds.target }} (on ${{ matrix.supporteds.runner }})
|
||||
runs-on: ${{ matrix.supporteds.runner }}
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
# https://github.com/rust-lang/stacker/issues/80#issuecomment-1547991131
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc # TODO: shouldn't this be something to do with musl, not gcc?
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install prerequisite build chain
|
||||
if: matrix.supporteds.install_prerequisite
|
||||
run: ${{ matrix.supporteds.install_prerequisite }}
|
||||
|
||||
- name: Install stable Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.supporteds.target }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: ${{ matrix.supporteds.target }}
|
||||
cache-on-failure: "true"
|
||||
|
||||
- name: Check
|
||||
run: cargo check --verbose --target ${{ matrix.supporteds.target }}
|
||||
|
||||
- name: Build
|
||||
run: cargo build --verbose --target ${{ matrix.supporteds.target }}
|
||||
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
supporteds:
|
||||
- runner: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
|
||||
- runner: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
|
||||
# Not able to be tested in GitHub Actions (without emulation, at least)
|
||||
# - runner: ubuntu-latest
|
||||
# target: aarch64-unknown-linux-gnu
|
||||
|
||||
# Not able to be tested in GitHub Actions (without emulation, at least)
|
||||
# - runner: ubuntu-latest
|
||||
# target: aarch64-unknown-linux-musl
|
||||
|
||||
- runner: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
|
||||
- runner: ubuntu-latest
|
||||
target: x86_64-unknown-linux-musl
|
||||
|
||||
# Not able to be tested in GitHub Actions (without emulation, at least)
|
||||
# - runner: windows-latest
|
||||
# target: aarch64-pc-windows-gnullvm
|
||||
|
||||
# Not able to be tested in GitHub Actions (without emulation, at least)
|
||||
# - runner: windows-latest
|
||||
# target: aarch64-pc-windows-msvc
|
||||
|
||||
- runner: windows-latest
|
||||
target: x86_64-pc-windows-gnu
|
||||
|
||||
- runner: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
name: Test ${{ matrix.supporteds.target }} (on ${{ matrix.supporteds.runner }})
|
||||
runs-on: ${{ matrix.supporteds.runner }}
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install stable Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.supporteds.target }}
|
||||
|
||||
- name: Install Nextest
|
||||
uses: taiki-e/install-action@cargo-nextest
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Check
|
||||
run: cargo check --verbose
|
||||
|
||||
- name: Formatting
|
||||
run: cargo fmt --check --verbose
|
||||
|
||||
- name: Build
|
||||
run: cargo build --verbose
|
||||
|
||||
- name: Test
|
||||
run: cargo nextest run
|
||||
run: cargo nextest run --target ${{ matrix.supporteds.target }}
|
||||
|
||||
minimal-dependencies-check-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -52,11 +171,11 @@ jobs:
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Check (direct minimal dependencies)
|
||||
- name: Check (minimal direct dependencies)
|
||||
run: cargo minimal-versions check --direct --workspace
|
||||
|
||||
- name: Build (direct minimal dependencies)
|
||||
- name: Build (minimal direct dependencies)
|
||||
run: cargo minimal-versions build --direct --workspace
|
||||
|
||||
- name: Test (direct minimal dependencies)
|
||||
- name: Test (minimal direct dependencies)
|
||||
run: cargo minimal-versions test --direct --workspace
|
||||
|
@@ -9,8 +9,52 @@ on:
|
||||
|
||||
jobs:
|
||||
compile-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
if: ${{ startsWith(github.event.release.tag_name, format('{0}-v', matrix.crate)) }}
|
||||
strategy:
|
||||
matrix:
|
||||
crate:
|
||||
- ac-qu-ai-nt
|
||||
- ac-qu-ai-nt-cli-clap
|
||||
supporteds:
|
||||
- runner: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
|
||||
- runner: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
|
||||
- install_prerequisite: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu
|
||||
runner: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
|
||||
- install_prerequisite: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu
|
||||
runner: ubuntu-latest
|
||||
target: aarch64-unknown-linux-musl
|
||||
|
||||
- runner: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
|
||||
- runner: ubuntu-latest
|
||||
target: x86_64-unknown-linux-musl
|
||||
|
||||
# I would like to support this but I don't know how to install the dependencies to be able to
|
||||
# - runner: windows-latest
|
||||
# target: aarch64-pc-windows-gnullvm
|
||||
|
||||
- runner: windows-latest
|
||||
target: aarch64-pc-windows-msvc
|
||||
|
||||
- runner: windows-latest
|
||||
target: x86_64-pc-windows-gnu
|
||||
|
||||
- runner: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
name: Compile ${{ matrix.supporteds.target }} for release (on ${{ matrix.supporteds.runner }})
|
||||
runs-on: ${{ matrix.supporteds.runner }}
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
# https://github.com/rust-lang/stacker/issues/80#issuecomment-1547991131
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc # TODO: shouldn't this be something to do with musl, not gcc?
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -19,11 +63,15 @@ jobs:
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: ${{ matrix.supporteds.target }}
|
||||
cache-on-failure: "true"
|
||||
|
||||
- name: Build for release
|
||||
run: cargo build --release --verbose
|
||||
|
||||
- uses: taiki-e/upload-rust-binary-action@v1
|
||||
with:
|
||||
bin: ac-qu-ai-nt
|
||||
bin: ${{ matrix.crate }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
target: ${{ matrix.supporteds.target }}
|
||||
|
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -4,7 +4,7 @@ version = 3
|
||||
|
||||
[[package]]
|
||||
name = "ac-qu-ai-nt"
|
||||
version = "0.0.4"
|
||||
version = "0.0.7"
|
||||
dependencies = [
|
||||
"ac-qu-ai-nt-cli-clap",
|
||||
"clap",
|
||||
@@ -14,7 +14,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ac-qu-ai-nt-cli-clap"
|
||||
version = "0.0.4"
|
||||
version = "0.0.5"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"tracing",
|
||||
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.0.5](https://github.com/babichjacob/ac-qu-ai-nt/compare/ac-qu-ai-nt-cli-clap-v0.0.4...ac-qu-ai-nt-cli-clap-v0.0.5) - 2024-10-05
|
||||
|
||||
### Other
|
||||
|
||||
- change `Hello, world!` to `What's up world?` to allow me to cut a release
|
||||
|
||||
## [0.0.4](https://github.com/babichjacob/ac-qu-ai-nt/compare/ac-qu-ai-nt-cli-clap-v0.0.3...ac-qu-ai-nt-cli-clap-v0.0.4) - 2024-09-30
|
||||
|
||||
### Added
|
||||
|
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "ac-qu-ai-nt-cli-clap"
|
||||
description = "A CLI (written with clap) for ac-qu-ai-nt"
|
||||
version = "0.0.4"
|
||||
version = "0.0.5"
|
||||
edition = "2021"
|
||||
rust-version = "1.76"
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
pub fn main() {
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::info!("Hello, world!");
|
||||
tracing::info!("What's up, world?");
|
||||
}
|
||||
|
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.0.7](https://github.com/babichjacob/ac-qu-ai-nt/compare/ac-qu-ai-nt-v0.0.6...ac-qu-ai-nt-v0.0.7) - 2024-10-05
|
||||
|
||||
### Other
|
||||
|
||||
- updated the following local packages: ac-qu-ai-nt-cli-clap
|
||||
|
||||
## [0.0.6](https://github.com/babichjacob/ac-qu-ai-nt/compare/ac-qu-ai-nt-v0.0.5...ac-qu-ai-nt-v0.0.6) - 2024-10-05
|
||||
|
||||
### Fixed
|
||||
|
||||
- cover the new cases of `Command` for `GuiEframe` and `TuiRatatui`
|
||||
|
||||
### Other
|
||||
|
||||
- correctly add `gui-eframe` and `tui-ratatui` as features this time around
|
||||
- add `gui-eframe` and `tui-ratatui` as subcommands with aliases `gui` and `tui` respectively
|
||||
- add `gui-eframe` and `tui-ratatui` as features
|
||||
|
||||
## [0.0.5](https://github.com/babichjacob/ac-qu-ai-nt/compare/ac-qu-ai-nt-v0.0.4...ac-qu-ai-nt-v0.0.5) - 2024-10-05
|
||||
|
||||
### Other
|
||||
|
||||
- [**breaking**] put accessing the cli under a subcommand like the README suggests it would be
|
||||
|
||||
## [0.0.4](https://github.com/babichjacob/ac-qu-ai-nt/compare/ac-qu-ai-nt-v0.0.3...ac-qu-ai-nt-v0.0.4) - 2024-09-30
|
||||
|
||||
### Added
|
||||
|
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "ac-qu-ai-nt"
|
||||
description = "A WIP project using AI to break down a user's query, acquire the knowledge to answer it, then transfer those insights to the user"
|
||||
version = "0.0.4"
|
||||
version = "0.0.7"
|
||||
edition = "2021"
|
||||
rust-version = "1.76"
|
||||
|
||||
@@ -10,12 +10,16 @@ license = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["cli-clap", "tracing"]
|
||||
default = ["cli-clap", "gui-eframe", "tui-ratatui", "tracing"]
|
||||
|
||||
cli-clap = ["dep:ac-qu-ai-nt-cli-clap"]
|
||||
gui-eframe = []
|
||||
tui-ratatui = []
|
||||
|
||||
tracing = ["dep:tracing-subscriber", "ac-qu-ai-nt-cli-clap?/tracing"]
|
||||
|
||||
[dependencies]
|
||||
ac-qu-ai-nt-cli-clap = { version = "0.0.4", path = "../cli-clap", optional = true }
|
||||
ac-qu-ai-nt-cli-clap = { version = "0.0.5", path = "../cli-clap", optional = true }
|
||||
clap = { workspace = true, features = ["derive", "env"] }
|
||||
dirs-next = "2.0.0"
|
||||
tracing-subscriber = { version = "0.3.18", optional = true }
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use std::{fs::create_dir_all, io::ErrorKind, path::PathBuf};
|
||||
|
||||
use clap::Parser;
|
||||
use clap::{Parser, Subcommand};
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct Args {
|
||||
@@ -10,11 +10,28 @@ struct Args {
|
||||
default_value_os_t = dirs_next::data_local_dir().expect("sorry but you're on a platform where dirs_next::data_local_dir() returned None, so please specify a data directory for the application").join("ac-qu-ai-nt")
|
||||
)]
|
||||
application_data_directory: PathBuf,
|
||||
|
||||
#[command(subcommand)]
|
||||
command: Command,
|
||||
}
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
enum Command {
|
||||
#[cfg(feature = "cli-clap")]
|
||||
#[command(alias = "cli")]
|
||||
CliClap,
|
||||
#[cfg(feature = "gui-eframe")]
|
||||
#[command(alias = "gui")]
|
||||
GuiEframe,
|
||||
#[cfg(feature = "tui-ratatui")]
|
||||
#[command(alias = "tui")]
|
||||
TuiRatatui,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let Args {
|
||||
application_data_directory,
|
||||
command,
|
||||
} = Args::parse();
|
||||
|
||||
#[cfg(feature = "tracing")]
|
||||
@@ -38,6 +55,12 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "cli-clap")]
|
||||
ac_qu_ai_nt_cli_clap::main();
|
||||
match command {
|
||||
#[cfg(feature = "cli-clap")]
|
||||
Command::CliClap => ac_qu_ai_nt_cli_clap::main(),
|
||||
#[cfg(feature = "gui-eframe")]
|
||||
Command::GuiEframe => todo!(),
|
||||
#[cfg(feature = "tui-ratatui")]
|
||||
Command::TuiRatatui => todo!(),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user