Skip to content

Commit

Permalink
configs and readme
Browse files Browse the repository at this point in the history
Signed-off-by: Bence Csati <[email protected]>
  • Loading branch information
csatib02 committed Sep 21, 2024
1 parent 4ebc332 commit 8d18c32
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 7 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,46 @@ jobs:
- name: Check commit messages
run: nix develop --impure .#ci -c pre-commit run --hook-stage manual

license-check:
name: License check
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

- name: Set up Nix
uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Set up magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@eeabdb06718ac63a7021c6132129679a8e22d0c7 # v3

- name: Cache license information
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: .licensei.cache
key: licensei-v1-${{ github.ref_name }}-${{ hashFiles('go.sum') }}
restore-keys: |
licensei-v1-${{ github.ref_name }}
licensei-v1-main
licensei-v1
- name: Prepare Nix shell
run: nix develop --impure .#ci

- name: Populate license cache
run: nix develop --impure .#ci -c licensei cache
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check licenses
run: nix develop --impure .#ci -c make license-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dev:
name: Developer environment
runs-on: ubuntu-latest
Expand Down
55 changes: 55 additions & 0 deletions .licensei.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
approved = [
"apache-2.0",
"mit",
"mit-0",
"bsd-2-clause",
"bsd-3-clause",
"mpl-2.0",
"isc",
"epl-2.0",
"richard-crowley",
]

ignored = [
"github.com/xeipuuv/gojsonpointer", # Apache 2.0
"github.com/xeipuuv/gojsonreference", # Apache 2.0
"github.com/xeipuuv/gojsonschema", # Apache 2.0
"github.com/couchbase/gocbcoreps", # Apache 2.0
"github.com/confluentinc/confluent-kafka-go/v2", # Apache 2.0
"github.com/JohnCGriffin/overflow", # MIT
"github.com/invopop/yaml", # MIT
"github.com/form3tech-oss/jwt-go", #MIT
"github.com/russross/blackfriday/v2", # 2-Clause BSD
"github.com/gogo/protobuf", # 3-Clause BSD
"github.com/rcrowley/go-metrics", # Richard Crowley

"cuelang.org/go", # Apache 2.0
"go.mongodb.org/mongo-driver", # Apache 2.0

# Unsupported VCS
"google.golang.org/protobuf", # 3-Clause BSD
"modernc.org/libc", # 3-Clause BSD
"modernc.org/mathutil", # 3-Clause BSD
"modernc.org/memory", # 3-Clause BSD
"modernc.org/sqlite", # 3-Clause BSD

# No license
"github.com/couchbase/goprotostellar",
]

[header]
ignorePaths = [".devenv", ".direnv", "vendor", "client", ".gen"]
ignoreFiles = ["*.gen.go"]
template = """// Copyright © :YEAR: Tailfin Cloud Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License."""
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ config.yaml:
cp config.example.yaml config.yaml

.PHONY: server
server: ## Run sink-worker
server: ## Run server
@ if [ config.yaml -ot config.example.yaml ]; then diff -u config.yaml config.example.yaml || (echo "!!! The configuration example changed. Please update your config.yaml file accordingly (or at least touch it). !!!" && false); fi
$(call print-target)
air -c ./cmd/server/.air.toml
Expand Down Expand Up @@ -95,6 +95,12 @@ lint: ## Run linters
$(call print-target)
dagger call lint all

.PHONY: license-check
license-check: ## Run license check
$(call print-target)
licensei check
licensei header

.PHONY: fmt
fmt: ## Format code
$(call print-target)
Expand Down
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,11 @@ Run the dependencies:
make up
```

Run OpenMeter:

```sh
make run
```

Run tests:

```sh
make test
make etoe
```

Run linters:
Expand All @@ -152,6 +147,24 @@ Run linters:
make lint
```

Some linter violations can automatically be fixed:

```shell
make fmt
```

Generate go code:

```shell
make generate
```

Once you are done, you can tear down project dependencies:

```shell
make down
```

## Roadmap

Visit our website at [https://openmeter.io](https://openmeter.io#roadmap) for our public roadmap.
Expand Down

0 comments on commit 8d18c32

Please sign in to comment.