From f52e670221b76fc70773eaeebb599aced4142cca Mon Sep 17 00:00:00 2001 From: "lijiacheng.ljc" Date: Tue, 5 Mar 2024 16:54:55 +0800 Subject: [PATCH] ci: add build ci --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ internal/sdk.go | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..a81bb3cf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: VersionFox CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + go-version: [ '1.21.x' ] + + steps: + - uses: actions/checkout@v4 + - name: Setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - name: Display Go version + run: go version + - name: Install dependencies + run: | + go get . + - name: Build with the Go CLI + run: | + go build . + - name: Test with the Go CLI + run: | + go test ./internal diff --git a/internal/sdk.go b/internal/sdk.go index 1fc33ea7..58012b13 100644 --- a/internal/sdk.go +++ b/internal/sdk.go @@ -287,7 +287,7 @@ func (b *Sdk) Use(version Version, scope UseScope) error { } } b.sdkManager.Record.Add(b.Plugin.Filename, string(version)) - err := b.sdkManager.Record.Save() + err = b.sdkManager.Record.Save() if err != nil { return err }