diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6033a68 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: ~/.cache/biome + key: biome-${{ runner.os }}-${{ hashFiles('biome.json') }} + restore-keys: biome-${{ runner.os }}- + - uses: biomejs/setup-biome@v2 + with: + version: 2.1.2 + - run: biome ci --linter-enabled=true --formatter-enabled=true + + typecheck: + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 10 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: frontend/pnpm-lock.yaml + - run: pnpm install --frozen-lockfile + - run: pnpm typecheck + + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 10 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: frontend/pnpm-lock.yaml + - run: pnpm install --frozen-lockfile + - run: pnpm build + + rust: + runs-on: ubuntu-latest + # Match the backend Dockerfile's build image so bindgen sees a libclang + # new enough for the upstream C23 (`constexpr`) headers from monad-bft. + container: rust:1.91-slim + steps: + - name: Install build dependencies + run: | + apt-get update + apt-get install -y git curl gcc g++ cmake pkg-config libssl-dev libclang-dev libzstd-dev libhugetlbfs-dev + - uses: actions/checkout@v4 + - run: rustup component add rustfmt clippy + - uses: Swatinem/rust-cache@v2 + - run: cargo fmt --all --check + - run: cargo clippy --all-targets --all-features -- -D warnings + - run: cargo build --all-targets diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index a45e8ad..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Lint - -on: - pull_request: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Cache Biome - uses: actions/cache@v4 - with: - path: ~/.cache/biome - key: biome-${{ runner.os }}-${{ hashFiles('biome.json') }} - restore-keys: | - biome-${{ runner.os }}- - - name: Setup Biome - uses: biomejs/setup-biome@v2 - with: - version: 2.1.2 - - name: Run Biome - run: biome ci --linter-enabled=true --formatter-enabled=true diff --git a/frontend/package.json b/frontend/package.json index e514025..5367bdc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "eslint" + "lint": "eslint", + "typecheck": "tsc --noEmit" }, "dependencies": { "@number-flow/react": "0.5.10",