Skip to content

Commit

Permalink
ci: ensure fmt (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
cugu authored Nov 5, 2023
1 parent 0d7a8e3 commit ec577d5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v22
- uses: cachix/install-nix-action@v23
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -40,9 +40,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v22
- uses: cachix/install-nix-action@v23
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -54,9 +54,9 @@ jobs:
ensure-generated:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v22
- uses: cachix/install-nix-action@v23
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -67,3 +67,20 @@ jobs:

- name: Ensure clean
run: git diff --exit-code

ensure-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v23
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Fmt
run: nix develop --command xc fmt

- name: Ensure clean
run: git diff --exit-code
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ go run ./cmd/templ generate -include-version=false && go test ./... -bench=. -be

### fmt

Format all Go code.
Format all Go and templ code.

```
```sh
gofmt -s -w .
go run ./cmd/templ fmt .
```

### lint
Expand All @@ -124,7 +125,7 @@ Run the development server.

Directory: docs

```
```sh
npm run start
```

Expand All @@ -134,7 +135,7 @@ Build production docs site.

Directory: docs

```
```sh
npm run build
```

0 comments on commit ec577d5

Please sign in to comment.