Skip to content
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
82 changes: 41 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ "main", "develop" ]
branches: ["main", "develop"]
pull_request:
branches: [ "main", "develop" ]
branches: ["main", "develop"]
workflow_dispatch:

env:
Expand All @@ -15,15 +15,15 @@ jobs:
runs-on: ubuntu-latest

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

- uses: taiki-e/install-action@v2
with:
tool: cargo-binstall
- uses: taiki-e/install-action@v2
with:
tool: cargo-binstall

- run: cargo binstall -y rust-script@0.34.0
- run: cargo binstall -y rust-script@0.34.0

- run: rust-script _scripts/check-templates.rs
- run: rust-script _scripts/check-templates.rs

fmt-clippy:
strategy:
Expand All @@ -34,36 +34,36 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Clone the Shuttle main repository
if: ${{ github.ref == 'refs/heads/develop' || github.base_ref == 'develop' }}
run: |
git clone --depth 1 --branch main https://github.com/shuttle-hq/shuttle.git /home/runner/shuttle
cd /home/runner/shuttle
git log -1 --format='%H'

- name: Apply patches
if: ${{ github.ref == 'refs/heads/develop' || github.base_ref == 'develop' }}
run: /home/runner/shuttle/scripts/apply-patches.sh .cargo/config.toml /home/runner/shuttle

- name: Install sccache
run: |
SCCACHE_VERSION='v0.7.7'
curl -L https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz \
| tar -xOz sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache \
> /home/runner/.cargo/bin/sccache \
&& chmod +x /home/runner/.cargo/bin/sccache

# bevy dependency
- run: sudo apt install -y libasound2-dev libudev-dev

- name: Check formatting and Clippy
shell: bash
run: _scripts/ci.sh ${{ matrix.from-to }}
env:
RUSTC_WRAPPER: /home/runner/.cargo/bin/sccache
CARGO_TARGET_DIR: /tmp/target

- name: Show sccache stats
run: /home/runner/.cargo/bin/sccache --show-stats
- uses: actions/checkout@v4

- name: Clone the Shuttle main repository
if: ${{ github.ref == 'refs/heads/develop' || github.base_ref == 'develop' }}
run: |
git clone --depth 1 --branch main https://github.com/shuttle-hq/shuttle.git /home/runner/shuttle
cd /home/runner/shuttle
git log -1 --format='%H'

- name: Apply patches
if: ${{ github.ref == 'refs/heads/develop' || github.base_ref == 'develop' }}
run: /home/runner/shuttle/scripts/apply-patches.sh .cargo/config.toml /home/runner/shuttle

- name: Install sccache
run: |
SCCACHE_VERSION='v0.7.7'
curl -L https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz \
| tar -xOz sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache \
> /home/runner/.cargo/bin/sccache \
&& chmod +x /home/runner/.cargo/bin/sccache

# bevy dependency
- run: sudo apt update && sudo apt install -y libasound2-dev libudev-dev

- name: Check formatting and Clippy
shell: bash
run: _scripts/ci.sh ${{ matrix.from-to }}
env:
RUSTC_WRAPPER: /home/runner/.cargo/bin/sccache
CARGO_TARGET_DIR: /tmp/target

- name: Show sccache stats
run: /home/runner/.cargo/bin/sccache --show-stats
1 change: 1 addition & 0 deletions axum/ai-assisted/.cursor/rules/shuttle.mdc
69 changes: 69 additions & 0 deletions axum/ai-assisted/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
alwaysApply: true
---

# Shuttle Development Rules

## Core Setup

Always use `#[shuttle_runtime::main]` as your entry point. Can be other frameworks too, you can use the Shuttle MCP - search docs tool to find the correct code for your framework.

```rust
#[shuttle_runtime::main]
async fn main() -> ShuttleAxum {
let router = Router::new().route("/", get(hello));
Ok(router.into())
}
```

## Databases

- **Shared DB** (free): `#[shuttle_shared_db::Postgres] pool: PgPool`
- **AWS RDS** (paid): `#[shuttle_aws_rds::Postgres] pool: PgPool`

## Secrets

Create `Secrets.toml` in project root, add to `.gitignore`:

```toml
MY_API_KEY = 'your-api-key-here'
```

Use in code:

```rust
#[shuttle_runtime::main]
async fn main(#[shuttle_runtime::Secrets] secrets: SecretStore) -> ShuttleAxum {
let api_key = secrets.get("MY_API_KEY").unwrap();
Ok(router.into())
}
```

## Static Assets

Configure in `Shuttle.toml`:

```toml
[build]
assets = [
"assets/*",
"frontend/dist/*",
"static/*"
]

[deploy]
include = ["ignored-files/*"] # Include files that are normally ignored by git
deny_dirty = true
```

## Development Workflow

1. `shuttle run` - local development
2. Use MCP server for AI-assisted development
3. Use MCP server for Searching the Docs

## Key Points

- Always use `#[shuttle_runtime::main]` as your entry point
- Configure static assets in `Shuttle.toml`
- Use secrets for sensitive configuration
Loading