diff --git a/.github/workflows/golanglint-ci.yml b/.github/workflows/golanglint-ci.yml deleted file mode 100644 index 53d954b..0000000 --- a/.github/workflows/golanglint-ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Lint - -on: - push: - pull_request: - types: [opened, reopened] -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: '1.20' - cache: false - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.54 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81a49d3..afb530c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,17 +1,27 @@ -name: Tests - -on: - push: +name: "Tests" +on: ["push"] jobs: - build: - runs-on: ubuntu-latest + ci: + name: "Run CI" + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macOS-latest"] + go: ["1.20.x"] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + - uses: WillAbides/setup-go-faster@v1.14.0 with: - fetch-depth: 2 - - uses: actions/setup-go@v3 + go-version: ${{ matrix.go }} + - run: "go test ./..." + - run: "go vet ./..." + - uses: dominikh/staticcheck-action@v1 with: - go-version: '1.20' - - name: Run tests - run: go test -v ./... \ No newline at end of file + version: "latest" + install-go: false + cache-key: ${{ matrix.go }} + working-directory: ${{ matrix.dir }} \ No newline at end of file diff --git a/config.go b/config.go index 2e978bf..80c8120 100644 --- a/config.go +++ b/config.go @@ -20,10 +20,6 @@ const ( DefaultPackfileDirectory = "pack" ) -func init() { - Configure() -} - var config Cnf type ( diff --git a/index_test.go b/index_test.go index d813682..8d6a1ab 100644 --- a/index_test.go +++ b/index_test.go @@ -6,6 +6,7 @@ import ( ) func TestAdd_WDUntracked(t *testing.T) { + assert.Nil(t, Configure()) idx := NewIndex() err := idx.Add(&File{Path: "test_assets/test.file", Sha: Sha{}, wdStatus: WDUntracked}) assert.Nil(t, err) diff --git a/integration_test.go b/integration_test.go index 5c9b76c..ea6474f 100644 --- a/integration_test.go +++ b/integration_test.go @@ -77,6 +77,7 @@ func Test_Library(t *testing.T) { // write the tree to the object store treeSha, err := tree.WriteTree() + e(err, t) // check for no previous commits pc, err := PreviousCommits()