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

Add initial CI #260

Merged
merged 28 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7821af9
Add initial CI
hatchan Sep 17, 2024
239acdc
Temporary force CI for current branch
hatchan Sep 17, 2024
bebd1da
Ensure pnpm is installed
hatchan Sep 17, 2024
3ef0a71
Use the latest version of pnpm
hatchan Sep 17, 2024
6d4b607
Add pnpm install step
hatchan Sep 17, 2024
bb651c1
Ensure fiberplane/fpx-types is checked in
hatchan Sep 17, 2024
701ad02
Ensure that Tauri required dependencies are installed
hatchan Sep 17, 2024
1eafb1e
Retrieve artifact using the tauri step output
hatchan Sep 17, 2024
f1e346c
Disable arm for Linux build for now
hatchan Sep 17, 2024
a9bccee
Try to join the artifact paths to get all the files
hatchan Sep 17, 2024
1a7d708
Decode from json first
hatchan Sep 17, 2024
b5cfc05
Use var directly
hatchan Sep 17, 2024
662c400
Multiline?
hatchan Sep 17, 2024
1c42322
Roundabout way :rolling_eyes:
hatchan Sep 17, 2024
f7b4f1f
Add debug message
hatchan Sep 17, 2024
3444159
Also include directories as artifacts
hatchan Sep 17, 2024
4b7159c
Use manual commands
hatchan Sep 17, 2024
9d049d7
Force bundles into a string value
hatchan Sep 17, 2024
b3c3df5
Escape arguments
hatchan Sep 17, 2024
29c8e83
No space allowed :(
hatchan Sep 17, 2024
2a7eaa1
Include target in artifact path
hatchan Sep 17, 2024
ec98e4d
Unblock frontends, build workflows
hatchan Sep 17, 2024
9016369
Resolve issues for cargo deny
hatchan Sep 17, 2024
cabc72f
Ensure tauri deps are installed during build_cli
hatchan Sep 17, 2024
bb8df43
Ignore generate code/json
hatchan Sep 17, 2024
19c4adb
Fix path
hatchan Sep 17, 2024
26865ab
Fix order
hatchan Sep 17, 2024
79b1e30
Resolve clippies
hatchan Sep 17, 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
27 changes: 13 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Test and build the project.
---
name: Build

name: Build cli
on:
# Allow manual trigger
workflow_dispatch:
Expand All @@ -12,23 +11,17 @@ on:

# Run on every push to main
push:
branches: ["main"]
branches: ["main", "tauri-main"]

jobs:
build:
name: Create binary for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest-8-cores

name: Create binary for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
env:
CARGO: cargo
TARGET_FLAGS: ""
TARGET_DIR: ../target
RUST_BACKTRACE: 1
- os: ubuntu-latest-8-cores
target: x86_64-unknown-linux-gnu

permissions:
id-token: write
Expand All @@ -40,6 +33,12 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest-8-cores'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
Expand All @@ -63,6 +62,6 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: fpx_${{ matrix.target }}
path: target/release/fpx
path: target/release/fpx-cli
if-no-files-found: error
retention-days: 7
98 changes: 98 additions & 0 deletions .github/workflows/build_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Build the fpx app. This will only be published as a build artifact.
---
name: Build app
on:
# Allow manual trigger
workflow_dispatch:

# Run on every pull request
pull_request:
branches: ["*"]

# Run on every push to main
push:
branches: ["main", "tauri-main"]

jobs:
build-app:
name: Create binary for ${{ matrix.target }}
runs-on: ${{ matrix.os }}

# permissions:
# id-token: write
# contents: read

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest-8-cores
target: x86_64-unknown-linux-gnu
bundles: appimage
- os: macos-latest
target: aarch64-apple-darwin
bundles: app,dmg
- os: macos-latest
target: x86_64-apple-darwin
bundles: app,dmg

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

# Steps required for our project, or our dependencies (like Tauri)

- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest-8-cores'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "pnpm"

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
target: ${{ matrix.target }}
rustflags: "" # Do not fail on warnings, so reset the default value to empty

- name: Install tauri-cli
run: cargo install [email protected]

# Steps related to our project

- name: Install dependencies
run: pnpm install
env:
CI: true

- name: Build shared types
run: pnpm build:types

- name: Build fpx-app
run: |
cargo tauri build \
--ci \
--target "${{ matrix.target }}" \
--bundles "${{ matrix.bundles }}"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: fpx_${{ matrix.target }}
if-no-files-found: error
retention-days: 7
path: target/${{ matrix.target }}/release/bundle
10 changes: 9 additions & 1 deletion .github/workflows/build_frontends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ env:
jobs:
build_packages:
name: Build packages
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies (Linux)
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
Expand All @@ -41,6 +46,9 @@ jobs:
env:
CI: true

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Build shared types
run: pnpm build:types

Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[workspace]
resolver = "2"
members = ["fpx", "fpx-app", "fpx-cli", "fpx-macros", "fpx-workers", "xtask"]
default-members = ["fpx-cli"]

[workspace.package]
authors = ["Fiberplane <[email protected]>"]
Expand Down
8 changes: 2 additions & 6 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,9 @@
".astro",

// ignore all tsconfig.json files
"tsconfig.json"
"tsconfig.json",

// Rust code related
// This caused biome to ignore the entire fpx folder
// commenting out for now as we still want to find a way to
// skip Rust code in biome
// "fpx/*.*"
"fpx-app/gen"
]
}
}
5 changes: 4 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[advisories]
ignore = []
ignore = [
"RUSTSEC-2024-0370", # unmaintained - proc-macro-error
]
yanked = "deny"

[licenses]
allow = [
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"BSD-3-Clause",
"ISC",
"MIT",
Expand Down
6 changes: 5 additions & 1 deletion fpx-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[package]
name = "fpx-app"
version = "0.1.0"
description = "A Tauri App"
edition = "2021"
version = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion fpx/src/api/handlers/traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn traces_get_handler(
// Retrieve all the spans that are associated with the trace
let spans = store.span_list_by_trace(&tx, &trace_id).await?;

let trace = TraceSummary::from_spans(trace_id.into(), spans).ok_or(TraceGetError::NotFound)?;
let trace = TraceSummary::from_spans(trace_id, spans).ok_or(TraceGetError::NotFound)?;

Ok(Json(trace))
}
Expand Down
4 changes: 3 additions & 1 deletion fpx/src/data/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ impl HexEncodedId {
pub fn as_inner(&self) -> &str {
&self.0
}
}

pub fn as_mut(&mut self) -> &mut str {
impl AsMut<str> for HexEncodedId {
fn as_mut(&mut self) -> &mut str {
&mut self.0
}
}
Expand Down
2 changes: 1 addition & 1 deletion studio/src/tauri/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Workspace } from "@fiberplane/fpx-types";
import { invoke } from "@tauri-apps/api/core";
import { open } from "@tauri-apps/plugin-dialog";
import { appDataDir } from "@tauri-apps/api/path";
import { open } from "@tauri-apps/plugin-dialog";

export async function listRecentWorkspaces() {
return await invoke<Array<string>>("list_recent_workspaces");
Expand Down
2 changes: 1 addition & 1 deletion xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = { workspace = true }
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive", "env"] }
fpx = { version = "0.1.0", path = "../fpx" }
fpx-app = { path = "../fpx-app" }
fpx-app = { version = "0.1.0", path = "../fpx-app" }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
Expand Down
Loading