Skip to content

Commit d695138

Browse files
Add CI workflow (#121)
I noticed this repository has no CI workflow (just Vercel preview deploys). This adds a simple CI workflow to confirm the build works and formatting hasn't changed, based on the one in connectrpc.com. Ref: https://github.com/connectrpc/connectrpc.com/blob/main/.github/workflows/ci.yaml
1 parent fcd04d3 commit d695138

8 files changed

Lines changed: 30 additions & 5 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: ci
2+
on:
3+
pull_request:
4+
branches: [main]
5+
workflow_dispatch:
6+
jobs:
7+
ci:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v6
11+
with:
12+
persist-credentials: false
13+
- uses: actions/setup-node@v6
14+
with:
15+
node-version-file: .nvmrc
16+
cache: npm
17+
- run: npm clean-install
18+
- run: npm run ci
19+
- name: Check Diff
20+
run: |
21+
[[ -z $(git status --porcelain | tee /dev/stderr) ]] || exit 1

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v24.14.0

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"check:fix": "biome check --write .",
1919
"write-translations": "docusaurus write-translations",
2020
"write-heading-ids": "docusaurus write-heading-ids",
21-
"typecheck": "tsc"
21+
"typecheck": "tsc",
22+
"ci": "npm run build && npm run check:fix"
2223
},
2324
"dependencies": {
2425
"@docusaurus/core": "^3.9.2",

src/theme/Footer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Link from "@docusaurus/Link";
1515
import { FooterLinkItem, useThemeConfig } from "@docusaurus/theme-common";
1616
import useBaseUrl from "@docusaurus/useBaseUrl";
1717
import clsx from "clsx";
18-
import React, { PropsWithChildren } from "react";
18+
import React, { type JSX, PropsWithChildren } from "react";
1919

2020
import IconMail from "./icon-envelope--gray.svg";
2121
import IconLinkedIn from "./icon-linkedin--gray.svg";

src/theme/Navbar/Content/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { Props as NavbarItemConfig } from "@theme/NavbarItem";
1111
import NavbarItem from "@theme/NavbarItem";
1212
import SearchBar from "@theme/SearchBar";
1313
import clsx from "clsx";
14-
import type React from "react";
14+
import type { JSX, ReactNode } from "react";
1515
import { MaintainedBy } from "../../components/maintained-by";
1616
import styles from "./styles.module.css";
1717

@@ -30,7 +30,7 @@ function NavbarItems({ items }: { items: NavbarItemConfig[] }): JSX.Element {
3030
return <div className={styles.linkList}>{renderedItems}</div>;
3131
}
3232

33-
function NavbarContentLayout({ left, right }: { left: React.ReactNode; right: React.ReactNode }) {
33+
function NavbarContentLayout({ left, right }: { left: ReactNode; right: ReactNode }) {
3434
return (
3535
<div className={clsx("navbar__inner", styles.inner)}>
3636
<div className="navbar__items">{left}</div>

src/theme/Navbar/Layout/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useIsScrolled } from "@site/src/utils/use-is-scrolled";
99
import type { Props } from "@theme/Navbar/Layout";
1010
import NavbarMobileSidebar from "@theme/Navbar/MobileSidebar";
1111
import clsx from "clsx";
12-
import type { ComponentProps } from "react";
12+
import type { ComponentProps, JSX } from "react";
1313
import styles from "./styles.module.css";
1414

1515
function NavbarBackdrop(props: ComponentProps<"div">) {

src/theme/Navbar/Logo/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { JSX } from "react";
12
import styles from "./styles.module.css";
23

34
export default function NavbarLogo(): JSX.Element {

src/theme/components/badge.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import clsx from "clsx";
2+
import type { JSX } from "react";
23

34
import styles from "./badge.module.css";
45

0 commit comments

Comments
 (0)