From b3c404ec09660b714a14929b5adef22062c6d0d9 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 29 Jan 2024 15:12:20 +0100 Subject: [PATCH] Update project infrastructure --- .github/workflows/main.yml | 39 +++++++++++++++----------------------- go.mod | 2 +- vfsafero_test.go | 4 +++- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b97164a..bbf2e78 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Main +name: main on: pull_request: push: @@ -7,29 +7,20 @@ on: tags: - v* jobs: - Test: - runs-on: ubuntu-20.04 + test: + runs-on: ubuntu-latest steps: - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16.0 - # FIXME re-enable when not broken - # - name: Cache Go modules - # uses: actions/cache@v2 - # with: - # path: ~/go/pkg/mod - # key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - # restore-keys: | - # ${{ runner.os }}-go- - - name: Checkout - uses: actions/checkout@v2 - - name: Build + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 + - name: build run: go build ./... - - name: Test + - name: test run: go test ./... - # FIXME re-enable when not broken - # - name: Lint - # uses: golangci/golangci-lint-action@v2 - # with: - # version: v1.37.0 + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 + - uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 + with: + version: v1.52.2 \ No newline at end of file diff --git a/go.mod b/go.mod index b14f426..ddd3c6f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/twpayne/go-vfsafero/v2 -go 1.16 +go 1.20 require ( github.com/spf13/afero v1.1.2 diff --git a/vfsafero_test.go b/vfsafero_test.go index 5bcaef0..f1daf14 100644 --- a/vfsafero_test.go +++ b/vfsafero_test.go @@ -19,7 +19,9 @@ func TestAferoFS(t *testing.T) { defer cleanup() aferoFS := NewAferoFS(fs) - afero.WriteFile(aferoFS, "/home/user/foo", []byte("bar"), 0666) + if err := afero.WriteFile(aferoFS, "/home/user/foo", []byte("bar"), 0666); err != nil { + t.Fatal(err) + } vfst.RunTests(t, fs, "", vfst.TestPath("/home/user/foo",