From b635430a1fce98a9c16729c75ea415e7ed6c1f00 Mon Sep 17 00:00:00 2001 From: Jonas Plum Date: Sat, 4 Nov 2023 23:38:57 +0100 Subject: [PATCH 1/4] Ensure fmt --- .github/workflows/ci.yml | 17 +++++++++++++++++ README.md | 9 +++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9df574e2..d1b529f10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,3 +67,20 @@ jobs: - name: Ensure clean run: git diff --exit-code + + ensure-fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: cachix/install-nix-action@v22 + 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 diff --git a/README.md b/README.md index fbc78f637..102fbe792 100644 --- a/README.md +++ b/README.md @@ -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 @@ -124,7 +125,7 @@ Run the development server. Directory: docs -``` +```sh npm run start ``` @@ -134,7 +135,7 @@ Build production docs site. Directory: docs -``` +```sh npm run build ``` From 07601e98545676981cde3dbdeef6225a2085e90f Mon Sep 17 00:00:00 2001 From: Jonas Plum Date: Sat, 4 Nov 2023 23:41:15 +0100 Subject: [PATCH 2/4] Update actions --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1b529f10..f3c270b6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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 }} @@ -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 }} @@ -71,9 +71,9 @@ jobs: ensure-fmt: 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 }} From 66155e55de97bf75e3ffa41c4cc56fddf0ea75c0 Mon Sep 17 00:00:00 2001 From: Jonas Plum Date: Sat, 4 Nov 2023 23:42:20 +0100 Subject: [PATCH 3/4] Trigger CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3c270b6f..acfd1949a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [main] + branches: [main,ensure-templ-fmt] pull_request: branches: [main] From d1eb0a6d04b53a638c4b4d6417013ae9f411b082 Mon Sep 17 00:00:00 2001 From: Jonas Plum Date: Sat, 4 Nov 2023 23:44:23 +0100 Subject: [PATCH 4/4] Disable branch CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acfd1949a..f3c270b6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [main,ensure-templ-fmt] + branches: [main] pull_request: branches: [main]