From 8753fd0e1d5caac353a822ba8caeeaab64afb16e Mon Sep 17 00:00:00 2001 From: Adam Babik Date: Sat, 3 Feb 2024 16:49:51 +0100 Subject: [PATCH] Update actions in ci workflow (#487) --- .github/workflows/ci.yml | 20 ++++++++++---------- .pre-commit-config.yaml | 8 +++++++- expect/expect.go | 2 +- internal/runnerv2service/execution.go | 2 +- internal/runnerv2service/service_sessions.go | 2 +- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63ab68b17..46e3f4d9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} - name: Install dependencies @@ -28,7 +28,7 @@ jobs: # to make sure that `make lint` also works. - name: Run lint from Makefile run: make lint - - uses: pre-commit/action@v2.0.3 + - uses: pre-commit/action@v3.0.0 - name: pre-commit run: pre-commit run --files $(git diff-tree --no-commit-id --name-only -r HEAD) @@ -46,13 +46,13 @@ jobs: fetch-depth: 0 fetch-tags: true - name: Setup go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} - name: Setup Node version - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Build run: | go build -o runme main.go @@ -70,7 +70,7 @@ jobs: make test if: ${{ matrix.os == 'windows-latest' }} - name: Upload coverage - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: ${{github.actor != 'dependabot[bot]' && matrix.os == 'ubuntu-latest'}} with: name: coverage @@ -86,11 +86,11 @@ jobs: with: fetch-depth: 0 - name: Setup Node version - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Setup go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ">=1.21" - name: Install dependencies @@ -118,7 +118,7 @@ jobs: with: fetch-depth: 0 - name: Retrieve saved coverage - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: coverage path: . diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7f3333f2a..2de80a340 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,16 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/codespell-project/codespell + rev: v2.2.4 + hooks: + - id: codespell + args: ["-L=ndoes,nd"] # words that are preceeded with "\n" + exclude: (package.*\.json$|go\.sum) - repo: https://github.com/TekWizely/pre-commit-golang rev: v1.0.0-rc.1 hooks: diff --git a/expect/expect.go b/expect/expect.go index 680ae9079..a4bae8d76 100644 --- a/expect/expect.go +++ b/expect/expect.go @@ -871,7 +871,7 @@ type GenOptions struct { Wait func() error // Close will be called as part of the expect Close, should normally include a Close of the In WriteCloser. Close func() error - // Check is called everytime a Send or Expect function is called to makes sure the session is still running. + // Check is called every time a Send or Expect function is called to makes sure the session is still running. Check func() bool } diff --git a/internal/runnerv2service/execution.go b/internal/runnerv2service/execution.go index da4178e2a..12cae0575 100644 --- a/internal/runnerv2service/execution.go +++ b/internal/runnerv2service/execution.go @@ -181,7 +181,7 @@ func (e *execution) Write(p []byte) (int, error) { n, err := e.stdinWriter.Write(p) // Close stdin writer for native commands after handling the initial request. - // Native commands do not support sending data continously, as the native + // Native commands do not support sending data continuously, as the native // command must have stdin closed to finish. // Alternatively, there should be a way to signal end of input. if _, ok := e.Cmd.(*command.NativeCommand); ok { diff --git a/internal/runnerv2service/service_sessions.go b/internal/runnerv2service/service_sessions.go index e86e58f49..1f479a04d 100644 --- a/internal/runnerv2service/service_sessions.go +++ b/internal/runnerv2service/service_sessions.go @@ -109,7 +109,7 @@ type updateRequest interface { } func (r *runnerService) updateSession(sess *command.Session, req updateRequest) error { - // Explictly passed env has higher priority and should be set first. + // Explicitly passed env has higher priority and should be set first. if err := sess.SetEnv(req.GetEnv()...); err != nil { return err }