diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml new file mode 100644 index 0000000..f68305f --- /dev/null +++ b/.github/workflows/go-test.yml @@ -0,0 +1,27 @@ +name: go-test +on: + push: + tags: + - v* + branches: + - master + - main + pull_request: +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '1.19.4' + + - name: Test With Coverage + run: go test -gcflags=-l -v --race --cover -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Run Vet & Lint + run: go vet ./... \ No newline at end of file diff --git a/.github/workflows/golangcli-lint.yml b/.github/workflows/golangcli-lint.yml new file mode 100644 index 0000000..4add6de --- /dev/null +++ b/.github/workflows/golangcli-lint.yml @@ -0,0 +1,45 @@ +name: golangci-lint +on: + push: + tags: + - v* + branches: + - master + - main + pull_request: +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.19.x + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: v1.53.3 + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + # args: --issues-exit-code=0 + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true + + Optional: if set to true then the action will use pre-installed Go. + skip-go-installation: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + # skip-build-cache: true \ No newline at end of file diff --git a/README.md b/README.md index 7108a7d..7ef93af 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![golangci-lint](https://github.com/g8rswimmer/go-tree-map/actions/workflows/golangcli-lint.yml/badge.svg)](https://github.com/g8rswimmer/go-tree-map/actions/workflows/golangcli-lint.yml) +[![go-test](https://github.com/g8rswimmer/go-tree-map/actions/workflows/go-test.yml/badge.svg)](https://github.com/g8rswimmer/go-tree-map/actions/workflows/go-test.yml) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) # Go Tree Map This Map is implemented using a [red-black tree](https://en.wikipedia.org/wiki/Red%E2%80%93black_tree) which allows for the keys to be ordered. When interating through the the maps pairs, key and value, those pairs will be return in descending order. This can be useful when iteration through the map needs to be deterministic.