Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .cargo/config.toml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2
updates:
# Enable version updates for Rust dependencies
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
groups:
cargo-dependencies:
patterns:
- "*"

# Enable version updates for npm dependencies (TypeScript SDK)
- package-ecosystem: "npm"
directory: "/packages/ftl-sdk-typescript"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
groups:
npm-dependencies:
patterns:
- "*"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
50 changes: 50 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# GitHub Workflows

This directory contains the CI/CD workflows for the FTL project.

## Workflows

### Core Workflows

- **[ci.yml](./ci.yml)** - Main CI pipeline that runs on every push and PR
- Linting (rustfmt, clippy)
- Building and testing the CLI
- Testing TypeScript and Rust SDKs
- Security audit

- **[release.yml](./release.yml)** - Release pipeline triggered by version tags
- Builds binaries for Linux, macOS (x86_64 and aarch64)
- Creates GitHub releases
- Publishes to crates.io and npm

### Quality Checks

- **[test-templates.yml](./test-templates.yml)** - Tests the project templates
- Creates projects with `ftl init`
- Adds components with `ftl add` for all languages
- Builds and tests each component type

- **[test-e2e.yml](./test-e2e.yml)** - End-to-end tests for each language
- Tests full ftl workflow: init, add, build, test
- Runs for Rust, TypeScript, and JavaScript
- Ensures templates work with actual ftl commands

- **[check-sdk-versions.yml](./check-sdk-versions.yml)** - Ensures SDK versions match templates
- Verifies Rust SDK version in Rust template
- Verifies TypeScript SDK version in TypeScript/JavaScript templates

- **[check-versions.yml](./check-versions.yml)** - Checks version consistency
- Ensures workspace and CLI versions match
- Warns about SDK version mismatches in templates

- **[check-docs.yml](./check-docs.yml)** - Documentation checks
- Verifies README links are valid
- Ensures CLI help matches documentation
- Checks template READMEs exist

## Dependabot

The [dependabot.yml](../dependabot.yml) configuration keeps dependencies updated:
- Cargo dependencies (weekly)
- npm dependencies for TypeScript SDK (weekly)
- GitHub Actions (weekly)
75 changes: 75 additions & 0 deletions .github/workflows/check-sdk-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Check SDK Versions

on:
push:
branches: [ main ]
paths:
- 'packages/ftl-sdk-*/**'
- 'packages/ftl-cli/src/templates/**'
pull_request:
branches: [ main ]
paths:
- 'packages/ftl-sdk-*/**'
- 'packages/ftl-cli/src/templates/**'

jobs:
check-versions:
name: Check SDK Version Consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Check Rust SDK version in template
run: |
SDK_VERSION=$(grep '^version' packages/ftl-sdk-rust/Cargo.toml | cut -d'"' -f2)
TEMPLATE_VERSION=$(grep 'ftl-sdk' packages/ftl-cli/src/templates/rust/content/handler/Cargo.toml | cut -d'"' -f2)

echo "Rust SDK version: $SDK_VERSION"
echo "Rust template SDK version: $TEMPLATE_VERSION"

if [ "$SDK_VERSION" != "$TEMPLATE_VERSION" ]; then
echo "Error: Rust SDK version ($SDK_VERSION) does not match template version ($TEMPLATE_VERSION)"
echo "Please update packages/ftl-cli/src/templates/rust/content/handler/Cargo.toml"
exit 1
fi

- name: Check TypeScript SDK version in TypeScript template
run: |
SDK_VERSION=$(node -p "require('./packages/ftl-sdk-typescript/package.json').version")
TEMPLATE_VERSION=$(node -p "require('./packages/ftl-cli/src/templates/typescript/content/handler/package.json').dependencies['@fastertools/ftl-sdk']")

# Remove any ^ or ~ prefix from template version
TEMPLATE_VERSION=${TEMPLATE_VERSION#^}
TEMPLATE_VERSION=${TEMPLATE_VERSION#~}

echo "TypeScript SDK version: $SDK_VERSION"
echo "TypeScript template SDK version: $TEMPLATE_VERSION"

if [ "$SDK_VERSION" != "$TEMPLATE_VERSION" ]; then
echo "Error: TypeScript SDK version ($SDK_VERSION) does not match template version ($TEMPLATE_VERSION)"
echo "Please update packages/ftl-cli/src/templates/typescript/content/handler/package.json"
exit 1
fi

- name: Check TypeScript SDK version in JavaScript template
run: |
SDK_VERSION=$(node -p "require('./packages/ftl-sdk-typescript/package.json').version")
TEMPLATE_VERSION=$(node -p "require('./packages/ftl-cli/src/templates/javascript/content/handler/package.json').dependencies['@fastertools/ftl-sdk']")

# Remove any ^ or ~ prefix from template version
TEMPLATE_VERSION=${TEMPLATE_VERSION#^}
TEMPLATE_VERSION=${TEMPLATE_VERSION#~}

echo "TypeScript SDK version: $SDK_VERSION"
echo "JavaScript template SDK version: $TEMPLATE_VERSION"

if [ "$SDK_VERSION" != "$TEMPLATE_VERSION" ]; then
echo "Error: TypeScript SDK version ($SDK_VERSION) does not match JavaScript template version ($TEMPLATE_VERSION)"
echo "Please update packages/ftl-cli/src/templates/javascript/content/handler/package.json"
exit 1
fi
66 changes: 66 additions & 0 deletions .github/workflows/check-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Check Version Consistency

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

jobs:
check-versions:
name: Check Version Consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check Cargo.toml versions match
run: |
# Get workspace version
WORKSPACE_VERSION=$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2)
echo "Workspace version: $WORKSPACE_VERSION"

# Check ftl-cli version
CLI_VERSION_LINE=$(grep '^version' packages/ftl-cli/Cargo.toml | head -1)

# Check if CLI uses workspace version
if echo "$CLI_VERSION_LINE" | grep -q "workspace = true"; then
echo "CLI version: inherited from workspace ($WORKSPACE_VERSION)"
else
CLI_VERSION=$(echo "$CLI_VERSION_LINE" | cut -d'"' -f2)
echo "CLI version: $CLI_VERSION"

if [ "$WORKSPACE_VERSION" != "$CLI_VERSION" ]; then
echo "Error: Workspace version ($WORKSPACE_VERSION) does not match CLI version ($CLI_VERSION)"
exit 1
fi
fi

- name: Check SDK dependency versions in templates
run: |
# Check Rust SDK version
RUST_SDK_VERSION=$(grep '^version' packages/ftl-sdk-rust/Cargo.toml | cut -d'"' -f2)
RUST_TEMPLATE_VERSION=$(grep 'ftl-sdk' packages/ftl-cli/src/templates/rust/content/handler/Cargo.toml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')

echo "Rust SDK version: $RUST_SDK_VERSION"
echo "Rust template SDK version: $RUST_TEMPLATE_VERSION"

if [ "$RUST_SDK_VERSION" != "$RUST_TEMPLATE_VERSION" ]; then
echo "Warning: Rust SDK version mismatch"
fi

# Check TypeScript SDK version
TS_SDK_VERSION=$(node -p "require('./packages/ftl-sdk-typescript/package.json').version")
TS_TEMPLATE_VERSION=$(node -p "require('./packages/ftl-cli/src/templates/typescript/content/handler/package.json').dependencies['@fastertools/ftl-sdk']" | sed 's/[\^~]//')
JS_TEMPLATE_VERSION=$(node -p "require('./packages/ftl-cli/src/templates/javascript/content/handler/package.json').dependencies['@fastertools/ftl-sdk']" | sed 's/[\^~]//')

echo "TypeScript SDK version: $TS_SDK_VERSION"
echo "TypeScript template SDK version: $TS_TEMPLATE_VERSION"
echo "JavaScript template SDK version: $JS_TEMPLATE_VERSION"

if [ "$TS_SDK_VERSION" != "$TS_TEMPLATE_VERSION" ]; then
echo "Warning: TypeScript SDK version mismatch in TypeScript template"
fi

if [ "$TS_SDK_VERSION" != "$JS_TEMPLATE_VERSION" ]; then
echo "Warning: TypeScript SDK version mismatch in JavaScript template"
fi
45 changes: 25 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ jobs:
components: rustfmt, clippy

- name: Cache cargo registry
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
Expand All @@ -44,7 +44,7 @@ jobs:
run: cargo fmt --all -- --check

- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
run: cargo clippy --all -- -D warnings

test:
name: Test
Expand All @@ -59,19 +59,19 @@ jobs:
run: rustup target add wasm32-wasip1

- name: Cache cargo registry
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
Expand All @@ -82,12 +82,14 @@ jobs:
- name: Run tests
run: cargo test --all-features

- name: Build WASM targets
- name: Test build templates
run: |
cargo build --package ftl-sdk-rs --target wasm32-wasip1
# Test that the embedded templates are valid
cd packages/ftl-cli
cargo build --release

test-typescript-sdk:
name: Test TypeScript SDK
test-sdks:
name: Test SDKs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -97,20 +99,23 @@ jobs:
with:
node-version: '20'

- name: Install dependencies
- name: Test TypeScript SDK
run: |
cd packages/ftl-sdk-ts
cd packages/ftl-sdk-typescript
npm ci

- name: Build TypeScript SDK
run: |
cd packages/ftl-sdk-ts
npm run build
npm test

- name: Run tests
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasip1

- name: Test Rust SDK
run: |
cd packages/ftl-sdk-ts
npm test
cd packages/ftl-sdk-rust
cargo test
cargo build --target wasm32-wasip1

security:
name: Security Audit
Expand Down
Loading