Skip to content

Commit

Permalink
Merge branch 'vitwit/avail-da' into chandini/avail-da
Browse files Browse the repository at this point in the history
  • Loading branch information
murthyvitwit authored Aug 9, 2023
2 parents 303d5ff + ad8190c commit 8cb14ba
Show file tree
Hide file tree
Showing 126 changed files with 2,252 additions and 2,382 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Version Release
uses: rollkit/.github/.github/actions/version-release@v0.1.1
uses: rollkit/.github/.github/actions/version-release@v0.2.2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
version-bump: ${{inputs.version}}
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-da-mockserv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
permissions:
contents: write
packages: write
uses: rollkit/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.1.1 # yamllint disable-line rule:line-length
uses: rollkit/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.2.2 # yamllint disable-line rule:line-length
with:
dockerfile: docker/mockserv.Dockerfile
packageName: mockserv
6 changes: 3 additions & 3 deletions .github/workflows/housekeeping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
issue-management:
if: ${{ github.event.issue }}
name: Add issues to project and add triage label
uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.1.1
uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.2.2
secrets: inherit
permissions:
issues: write
Expand All @@ -25,7 +25,7 @@ jobs:
# ignore dependabot PRs
if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }}
name: Add PRs to project
uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.1.1
uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.2.2
secrets: inherit
permissions:
issues: write
Expand All @@ -37,7 +37,7 @@ jobs:
auto-add-reviewer:
name: Auto add reviewer to PR
if: github.event.pull_request
uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.1.1
uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.2.2
secrets: inherit
permissions:
issues: write
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ jobs:

# hadolint lints the Dockerfile
hadolint:
uses: rollkit/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.1.1 # yamllint disable-line rule:line-length
uses: rollkit/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.2.2 # yamllint disable-line rule:line-length
with:
dockerfile: docker/mockserv.Dockerfile

yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rollkit/.github/.github/actions/yamllint@v0.1.1
- uses: rollkit/.github/.github/actions/yamllint@v0.2.2

markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rollkit/.github/.github/actions/markdown-lint@v0.1.1
- uses: rollkit/.github/.github/actions/markdown-lint@v0.2.2

protobuf-lint:
runs-on: ubuntu-latest
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,13 @@ jobs:
with:
go-version: ${{ inputs.GO_VERSION }}
- name: Run unit test
run: make test-unit
run: make test
- name: upload coverage report
uses: codecov/codecov-action@v3.1.4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt

unit_race_test:
name: Run Unit Tests with Race Detector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up go
uses: actions/setup-go@v4
with:
go-version: ${{ inputs.GO_VERSION }}
- name: execute test run
run: make test-unit-race

integration_test:
name: Run Integration Tests
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ linters-settings:
rules:
- name: package-comments
disabled: true
- name: duplicated-imports
severity: warning

goimports:
local-prefixes: github.com/rollkit
44 changes: 26 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf

# Define pkgs, run, and cover vairables for test so that we can override them in
# the terminal more easily.
pkgs := $(shell go list ./...)
run := .
count := 1

## help: Show this help message
help: Makefile
@echo " Choose a command run in "$(PROJECTNAME)":"
Expand All @@ -17,11 +23,19 @@ clean:
cover:
@echo "--> Generating Code Coverage"
@go install github.com/ory/go-acc@latest
@go-acc -o coverage.txt `go list ./...`
@go-acc -o coverage.txt $(pkgs)
.PHONY: cover

## deps: Install dependencies
deps:
@echo "--> Installing dependencies"
@go mod download
@make proto-gen
@go mod tidy
.PHONY: deps

## lint: Run linters golangci-lint and markdownlint.
lint:
lint: vet
@echo "--> Running golangci-lint"
@golangci-lint run
@echo "--> Running markdownlint"
Expand All @@ -39,23 +53,17 @@ fmt:
@markdownlint --config .markdownlint.yaml '**/*.md' -f
.PHONY: fmt

## test-unit: Running unit tests
test-unit:
@echo "--> Running unit tests"
@go test -covermode=atomic -coverprofile=coverage.txt `go list ./...`
.PHONY: test-unit
## vet: Run go vet
vet:
@echo "--> Running go vet"
@go vet $(pkgs)
.PHONY: vet

## test-unit-race: Running unit tests with data race detector
test-unit-race:
@echo "--> Running unit tests with data race detector"
@go test -race -count=1 `go list ./...`
.PHONY: test-unit-race

## test-all: Run tests with and without data race
test-all:
@$(MAKE) test-unit
@$(MAKE) test-unit-race
.PHONY: test-all
## test: Running unit tests
test: vet
@echo "--> Running unit tests"
@go test -v -race -covermode=atomic -coverprofile=coverage.txt $(pkgs) -run $(run) -count=$(count)
.PHONY: test

## proto-gen: Generate protobuf files. Requires docker.
proto-gen:
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,7 @@ The Rollkit v0.9.0 release is compatible with [Arabica](https://docs.celestia.or

```sh
# Run unit tests
make test-unit

# Run unit tests with the data race detector
make test-unit-race

# Run tests with and without the data race detector
make test-all
make test

# Generate protobuf files (requires Docker)
make proto-gen
Expand Down
Loading

0 comments on commit 8cb14ba

Please sign in to comment.