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

feat(gui): add base structure #1935

Merged
merged 19 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
318 changes: 184 additions & 134 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Rust

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

env:
CARGO_TERM_COLOR: always
Expand All @@ -17,32 +17,45 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}

- name: Run cargo build common
run: cargo build -p atuin-common --locked --release

- name: Run cargo build client
run: cargo build -p atuin-client --locked --release

- name: Run cargo build server
run: cargo build -p atuin-server --locked --release

- name: Run cargo build main
run: cargo build --all --locked --release
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}

- name: Install dependencies
if: matrix.os != 'macos-14' && matrix.os != 'windows-latest'
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev

- name: Run cargo build common
run: cargo build -p atuin-common --locked --release

- name: Run cargo build client
run: cargo build -p atuin-client --locked --release

- name: Run cargo build server
run: cargo build -p atuin-server --locked --release

- name: Run cargo build main
run: cargo build --all --locked --release

cross-compile:
strategy:
Expand All @@ -54,32 +67,32 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install cross
uses: taiki-e/install-action@v1
with:
tool: cross
- name: Install cross
uses: taiki-e/install-action@v1
with:
tool: cross

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.target }}-cross-compile-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.target }}-cross-compile-${{ hashFiles('**/Cargo.lock') }}

- name: Run cross build common
run: cross build -p atuin-common --locked --target ${{ matrix.target }}
- name: Run cross build common
run: cross build -p atuin-common --locked --target ${{ matrix.target }}

- name: Run cross build client
run: cross build -p atuin-client --locked --target ${{ matrix.target }}
- name: Run cross build client
run: cross build -p atuin-client --locked --target ${{ matrix.target }}

- name: Run cross build server
run: cross build -p atuin-server --locked --target ${{ matrix.target }}
- name: Run cross build server
run: cross build -p atuin-server --locked --target ${{ matrix.target }}

- name: Run cross build main
run: cross build --all --locked --target ${{ matrix.target }}
- name: Run cross build main
run: cross build --all --locked --target ${{ matrix.target }}

unit-test:
strategy:
Expand All @@ -88,29 +101,41 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- uses: taiki-e/install-action@v2
name: Install nextest
with:
tool: cargo-nextest


- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${ runner.os }-cargo-debug-${{ hashFiles('**/Cargo.lock') }}

- name: Run cargo test
run: cargo nextest run --lib --bins
- name: Install dependencies
if: matrix.os != 'macos-14' && matrix.os != 'windows-latest'
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev

- uses: taiki-e/install-action@v2
name: Install nextest
with:
tool: cargo-nextest

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${ runner.os }-cargo-debug-${{ hashFiles('**/Cargo.lock') }}

- name: Run cargo test
run: cargo nextest run --lib --bins

check:
strategy:
Expand All @@ -119,35 +144,48 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${ runner.os }-cargo-debug-${{ hashFiles('**/Cargo.lock') }}

- name: Run cargo check (all features)
run: cargo check --all-features --workspace

- name: Run cargo check (no features)
run: cargo check --no-default-features --workspace

- name: Run cargo check (sync)
run: cargo check --no-default-features --features sync --workspace

- name: Run cargo check (server)
run: cargo check --no-default-features --features server --workspace

- name: Run cargo check (client only)
run: cargo check --no-default-features --features client --workspace
- name: Install dependencies
if: matrix.os != 'macos-14' && matrix.os != 'windows-latest'
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${ runner.os }-cargo-debug-${{ hashFiles('**/Cargo.lock') }}

- name: Run cargo check (all features)
run: cargo check --all-features --workspace

- name: Run cargo check (no features)
run: cargo check --no-default-features --workspace

- name: Run cargo check (sync)
run: cargo check --no-default-features --features sync --workspace

- name: Run cargo check (server)
run: cargo check --no-default-features --features server --workspace

- name: Run cargo check (client only)
run: cargo check --no-default-features --features client --workspace

integration-test:
runs-on: ubuntu-latest
Expand All @@ -163,66 +201,78 @@ jobs:
- 5432:5432

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- uses: taiki-e/install-action@v2
name: Install nextest
with:
tool: cargo-nextest


- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${ runner.os }-cargo-debug-${{ hashFiles('**/Cargo.lock') }}

- name: Run cargo test
run: cargo nextest run --test '*'
env:
ATUIN_DB_URI: postgres://atuin:pass@localhost:5432/atuin
- uses: taiki-e/install-action@v2
name: Install nextest
with:
tool: cargo-nextest

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${ runner.os }-cargo-debug-${{ hashFiles('**/Cargo.lock') }}

- name: Run cargo test
run: cargo nextest run --test '*'
env:
ATUIN_DB_URI: postgres://atuin:pass@localhost:5432/atuin

clippy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install latest rust
uses: dtolnay/rust-toolchain@master
with:
- name: Install latest rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }}

- name: Run clippy
run: cargo clippy -- -D warnings

- name: Install dependencies
if: matrix.os != 'macos-14' && matrix.os != 'windows-latest'
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }}

- name: Run clippy
run: cargo clippy -- -D warnings

format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install latest rust
uses: dtolnay/rust-toolchain@master
with:
- name: Install latest rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt

- name: Format
run: cargo fmt -- --check
- name: Format
run: cargo fmt -- --check