Skip to content

Commit

Permalink
bump applicable actions to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Jun 10, 2024
1 parent 3ff62e5 commit 7d40472
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 47 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ 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') }}
restore-keys: |
${{ 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/)
Expand All @@ -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/
Expand All @@ -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') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/backend_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand All @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/frontend_lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -74,15 +74,15 @@ 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
run: |
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

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 7d40472

Please sign in to comment.