diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 8cf6dbf0..14d70519 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -19,13 +19,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: "1.22" - name: Cache Go Modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -33,6 +33,8 @@ jobs: ${{ runner.os }}-go - name: Install gofumpt run: go install mvdan.cc/gofumpt@latest + - name: templ + run: go install github.com/a-h/templ/cmd/templ@latest && templ generate - name: Check code formatting run: | unformatted_files=$(gofumpt -l ./backend/) @@ -49,13 +51,21 @@ jobs: pull-requests: read checks: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "1.22" - cache: false + - name: Cache Go Modules + uses: actions/cache@v4 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go + - name: templ + run: go install github.com/a-h/templ/cmd/templ@latest && templ generate - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: latest working-directory: ./backend/ @@ -74,13 +84,13 @@ jobs: - 5432:5432 steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: "1.22" - name: Cache Go Modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} diff --git a/.github/workflows/backend_codeql.yml b/.github/workflows/backend_codeql.yml index 69eb301b..3570080b 100644 --- a/.github/workflows/backend_codeql.yml +++ b/.github/workflows/backend_codeql.yml @@ -22,7 +22,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: "1.22" - name: Initialize CodeQL @@ -32,7 +32,7 @@ jobs: queries: security-and-quality - name: Build run: | - cd ./backend/ && go install github.com/a-h/templ/cmd/templ@latest && templ generate && go build -o backend main.go + go install github.com/a-h/templ/cmd/templ@latest && templ generate && cd ./backend/ && go build -o backend main.go - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index fa584ba5..4cd59de1 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -19,13 +19,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: "1.22" - name: Cache Go Modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -49,13 +49,13 @@ jobs: pull-requests: read checks: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "1.22" cache: false - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: latest working-directory: ./cli/ diff --git a/.github/workflows/cli_codeql.yml b/.github/workflows/cli_codeql.yml index cb09497e..7eb08c2a 100644 --- a/.github/workflows/cli_codeql.yml +++ b/.github/workflows/cli_codeql.yml @@ -22,7 +22,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: "1.22" - name: Initialize CodeQL diff --git a/.github/workflows/dashboard.yml b/.github/workflows/dashboard.yml index 2c13b7a0..0c5f56c9 100644 --- a/.github/workflows/dashboard.yml +++ b/.github/workflows/dashboard.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn @@ -34,9 +34,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn @@ -54,9 +54,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn diff --git a/.github/workflows/frontend_lib.yml b/.github/workflows/frontend_lib.yml index 029ea34a..f62be618 100644 --- a/.github/workflows/frontend_lib.yml +++ b/.github/workflows/frontend_lib.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn @@ -34,9 +34,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn @@ -54,9 +54,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn @@ -74,7 +74,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout current branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get new version of package.json id: get_new_version @@ -82,7 +82,7 @@ jobs: echo "new_version=$(jq -r '.version' frontend/lib/package.json)" >> $GITHUB_OUTPUT - name: Checkout main - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main diff --git a/.github/workflows/mobile.yml b/.github/workflows/mobile.yml index 39304c8e..eb5dde6d 100644 --- a/.github/workflows/mobile.yml +++ b/.github/workflows/mobile.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn @@ -34,9 +34,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn @@ -54,9 +54,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 81b21611..72b30a0b 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn @@ -34,9 +34,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn @@ -54,9 +54,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn diff --git a/cli/cmd/format.go b/cli/cmd/format.go index 788f5cf6..1800c7e9 100644 --- a/cli/cmd/format.go +++ b/cli/cmd/format.go @@ -102,7 +102,7 @@ var formatBackendCmd = &cobra.Command{ os.Exit(1) } - err = helpers.Execute(exec.Command("gofumpt", "-l", "-w", "."), helpers.BACKEND_DIR) + err = helpers.Execute(exec.Command("templ", "generate", "&&", "gofumpt", "-l", "-w", "."), helpers.BACKEND_DIR) if err != nil { fmt.Println(err) os.Exit(1) @@ -122,7 +122,7 @@ var formatCliCmd = &cobra.Command{ os.Exit(1) } - err = helpers.Execute(exec.Command("gofumpt", "-l", "-w", "."), helpers.CLI_DIR) + err = helpers.Execute(exec.Command("templ", "generate", "&&", "gofumpt", "-l", "-w", "."), helpers.CLI_DIR) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/cli/cmd/lint.go b/cli/cmd/lint.go index c1115ce4..f4ab19ab 100644 --- a/cli/cmd/lint.go +++ b/cli/cmd/lint.go @@ -102,7 +102,7 @@ var lintBackendCmd = &cobra.Command{ os.Exit(1) } - err = helpers.Execute(exec.Command("golangci-lint", "run", "--fix", "--timeout=1m"), helpers.BACKEND_DIR) + err = helpers.Execute(exec.Command("templ", "generate", "&&", "golangci-lint", "run", "--fix", "--timeout=1m"), helpers.BACKEND_DIR) if err != nil { fmt.Println(err) os.Exit(1) @@ -122,7 +122,7 @@ var lintCliCmd = &cobra.Command{ os.Exit(1) } - err = helpers.Execute(exec.Command("golangci-lint", "run", "--fix", "--timeout=1m"), helpers.CLI_DIR) + err = helpers.Execute(exec.Command("templ", "generate", "&&", "golangci-lint", "run", "--fix", "--timeout=1m"), helpers.CLI_DIR) if err != nil { fmt.Println(err) os.Exit(1)