diff --git a/.buildkite/docker-compose.yml b/.buildkite/docker-compose.yml deleted file mode 100644 index 6a4fecd..0000000 --- a/.buildkite/docker-compose.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: "3.8" -services: - ci: - volumes: - - ..:/src - build: - context: ../ - dockerfile: .buildkite/Dockerfile diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index ff7af4d..0000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,51 +0,0 @@ -agents: - queue: public - -env: - DOCKER_INLINE_CACHE: "1" - DOCKER_BUILDKIT: "1" - BUILDKIT_PROGRESS: plain - COMPOSE_FILE: .buildkite/docker-compose.yml - COMPOSE_DOCKER_CLI_BUILD: "1" - -steps: - - label: ":docker: Build" - plugins: - - docker-compose#v3.9.0: - build: ci - - - wait - - - name: tests - label: Tests - command: "make tests" - plugins: - - docker-compose#v3.9.0: - run: ci - - - name: Formatting - label: Formatting - command: "make clean-proto && make proto && make fmt && git diff --exit-code" - plugins: - - docker-compose#v3.9.0: - run: ci - - - name: gomod - label: "Make sure go.sum is up to date" - command: "go mod tidy && git diff --exit-code" - plugins: - - docker-compose#v3.9.0: - run: ci - - - name: lint - label: Lint - command: "make lint" - plugins: - - docker-compose#v3.9.0: - run: ci - - - name: Verify dependency licenses - command: "license_finder" - plugins: - - docker-compose#v3.9.0: - run: ci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..46070dc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +jobs: + checks: + name: ${{ matrix.name }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - name: Tests + command: make tests + - name: Formatting + command: make clean-proto && make proto && make fmt && git diff --exit-code + - name: go.mod tidy + command: go mod tidy && git diff --exit-code + - name: Lint + command: make lint + - name: Verify dependency licenses + command: license_finder + + env: + DOCKER_BUILDKIT: "1" + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run ${{ matrix.name }} + run: | + docker compose run --rm --build ci sh -c ' + git config --global --add safe.directory "$PWD" + + ${{ matrix.command }} + ' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 956e123..694164f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,9 @@ on: branches: - main +permissions: + contents: read + jobs: publish: name: publish buf module @@ -15,6 +18,8 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: setup go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 diff --git a/.github/workflows/zizmor.yaml b/.github/workflows/zizmor.yaml new file mode 100644 index 0000000..071cb53 --- /dev/null +++ b/.github/workflows/zizmor.yaml @@ -0,0 +1,32 @@ +name: zizmor + +on: + push: + branches: [ "main" ] + pull_request: + paths: + - '.github/**' + +permissions: + contents: read + actions: read + +jobs: + zizmor: + name: zizmor audit + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Run zizmor + uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2 + with: + inputs: . + persona: regular + version: "1.25.2" + # Fail the job directly instead of uploading SARIF to code scanning. + advanced-security: false + annotations: true diff --git a/.buildkite/Dockerfile b/Dockerfile.ci similarity index 88% rename from .buildkite/Dockerfile rename to Dockerfile.ci index 9c99113..51c045b 100644 --- a/.buildkite/Dockerfile +++ b/Dockerfile.ci @@ -1,4 +1,4 @@ -FROM golang:1.24-bookworm +FROM golang:1.26-bookworm RUN apt-get update && apt-get upgrade -y && \ apt-get install -y ruby && gem install license_finder && \ diff --git a/Makefile b/Makefile index 7752862..8824a27 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,8 @@ TOOL_INSTALL := env GOBIN=$(PWD)/$(BIN) go install $(BIN)/protoc-gen-go: go.mod | $(BIN) $(TOOL_INSTALL) google.golang.org/protobuf/cmd/protoc-gen-go -$(BIN)/protoc-gen-go-vtproto: Makefile | $(BIN) - $(TOOL_INSTALL) github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@v0.6.0 +$(BIN)/protoc-gen-go-vtproto: go.mod | $(BIN) + $(TOOL_INSTALL) github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto $(BIN)/protoc-gen-connect-go: go.mod | $(BIN) $(TOOL_INSTALL) connectrpc.com/connect/cmd/protoc-gen-connect-go diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9631e2a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + ci: + build: + context: . + dockerfile: Dockerfile.ci + volumes: + - .:/src + working_dir: /src