Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
- name: Checkout code.
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Unit test.
run: make unit-test
run: make unit-test
50 changes: 29 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,68 +1,76 @@
# So new files are owned by the user.
DOCKER_RUN_OPTS := --rm -v $(PWD):/workspace -w /workspace

UID := $(shell id -u)
GID := $(shell id -g)
DOCKER_RUN_WRITE_OPTS := $(DOCKER_RUN_OPTS) -u $(UID):$(GID)

.PHONY: check-clean-git-history check-conventional-commits-linting check-rust-formatting check-python-formatting check-yaml-formatting fix-rust-formatting fix-python-formatting fix-yaml-formatting check-rust-linting check-github-actions-workflows-linting compile unit-test static-binary-test end-to-end-test publish-binary publish-crate
.PHONY: default
default: compile

# renovate: depName=ghcr.io/developerc286/clean_git_history
CLEAN_GIT_HISTORY_VERSION=1.0.4@sha256:5783341a3377a723e409e72b9ec0826a75ba944288d030978355de05ef65b186

.PHONY: check-clean-git-history
check-clean-git-history:
docker pull ghcr.io/developerc286/clean_git_history:$(CLEAN_GIT_HISTORY_VERSION)
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/developerc286/clean_git_history:$(CLEAN_GIT_HISTORY_VERSION) $(FROM)
docker run $(DOCKER_RUN_WRITE_OPTS) ghcr.io/developerc286/clean_git_history:$(CLEAN_GIT_HISTORY_VERSION) $(FROM)

# renovate: depName=ghcr.io/developerc286/conventional_commits_linter
CONVENTIONAL_COMMITS_LINTER_VERSION=0.15.0@sha256:b631a3cdcbed28c8938a2a6b63e16ecfd0d7ff71c28e878815adf9183e1fb599

.PHONY: check-conventional-commits-linting
check-conventional-commits-linting:
docker pull ghcr.io/developerc286/conventional_commits_linter:$(CONVENTIONAL_COMMITS_LINTER_VERSION)
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/developerc286/conventional_commits_linter:$(CONVENTIONAL_COMMITS_LINTER_VERSION) --allow-angular-type-only $(FROM)
docker run $(DOCKER_RUN_WRITE_OPTS) ghcr.io/developerc286/conventional_commits_linter:$(CONVENTIONAL_COMMITS_LINTER_VERSION) --allow-angular-type-only $(FROM)

.PHONY: check-rust-formatting
check-rust-formatting:
docker build -t check-rust-formatting -f ci/check-rust-formatting.Dockerfile .
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) check-rust-formatting
docker run $(DOCKER_RUN_OPTS) check-rust-formatting

# renovate: depName=mvdan/shfmt
SHFMT_VERSION=v3.11.0-alpine@sha256:394d755b6007056a2e6d7537ccdbdcfca01b9855ba91e99df0166ca039c9d422

.PHONY: check-shell-formatting
check-shell-formatting:
docker pull mvdan/shfmt:$(SHFMT_VERSION)
docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) mvdan/shfmt:$(SHFMT_VERSION) --simplify --diff ci/*
docker run $(DOCKER_RUN_OPTS) mvdan/shfmt:$(SHFMT_VERSION) --simplify --diff ci/*

# renovate: depName=ghcr.io/google/yamlfmt
YAMLFMT_VERSION=0.17.2@sha256:fa6874890092db69f35ece6a50e574522cae2a59b6148a1f6ac6d510e5bcf3cc

.PHONY: check-yaml-formatting
check-yaml-formatting:
docker pull ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION)
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -lint -dstar .github/workflows/*
docker run $(DOCKER_RUN_OPTS) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -lint -dstar .github/workflows/*

.PHONY: fix-rust-formatting
fix-rust-formatting:
docker build -t fix-rust-formatting -f ci/fix-rust-formatting.Dockerfile .
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) fix-rust-formatting
docker run $(DOCKER_RUN_WRITE_OPTS) fix-rust-formatting

.PHONY: fix-shell-formatting
fix-shell-formatting:
docker pull mvdan/shfmt:$(SHFMT_VERSION)
docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) mvdan/shfmt:$(SHFMT_VERSION) --simplify --write ci/*
docker run $(DOCKER_RUN_WRITE_OPTS) mvdan/shfmt:$(SHFMT_VERSION) --simplify --write ci/*

.PHONY: fix-yaml-formatting
fix-yaml-formatting:
docker pull ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION)
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -dstar .github/workflows/*
docker run $(DOCKER_RUN_WRITE_OPTS) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -dstar .github/workflows/*

.PHONY: check-rust-linting
check-rust-linting:
docker build -t check-rust-linting -f ci/check-rust-linting.Dockerfile .
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) check-rust-linting
docker run $(DOCKER_RUN_OPTS) check-rust-linting

# renovate: depName=rhysd/actionlint
ACTIONLINT_VERSION=1.7.7@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9

.PHONY: check-github-actions-workflows-linting
check-github-actions-workflows-linting:
docker pull rhysd/actionlint:$(ACTIONLINT_VERSION)
docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) rhysd/actionlint:$(ACTIONLINT_VERSION) -verbose -color
docker run $(DOCKER_RUN_WRITE_OPTS) rhysd/actionlint:$(ACTIONLINT_VERSION) -verbose -color

.PHONY: compile
compile:
docker build -t compile -f ci/compile.Dockerfile .
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) compile
docker run $(DOCKER_RUN_WRITE_OPTS) compile

.PHONY: unit-test
unit-test:
docker build -t unit-test -f ci/unit-test.Dockerfile .
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) unit-test
docker run $(DOCKER_RUN_WRITE_OPTS) unit-test
2 changes: 0 additions & 2 deletions ci/check-rust-formatting.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM rust:1.88.0-alpine3.21@sha256:9c6a4baf58661f99a5441b15e3ad8295dabf35e849c4935e77ad35d9809be1d2
RUN rustup component add rustfmt

WORKDIR /workspace

ENTRYPOINT ["cargo", "fmt", "--all", "--", "--check", "--config=group_imports=StdExternalCrate"]
2 changes: 0 additions & 2 deletions ci/check-rust-linting.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ RUN apk add --no-cache \
musl-dev=1.2.5-r9
RUN rustup component add clippy

WORKDIR /workspace

ENTRYPOINT ["cargo", "clippy", "--verbose", "--target=x86_64-unknown-linux-musl", "--locked", "--", "-D", "warnings"]
2 changes: 0 additions & 2 deletions ci/compile.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ FROM rust:1.88.0-alpine3.21@sha256:9c6a4baf58661f99a5441b15e3ad8295dabf35e849c49
RUN apk add --no-cache \
musl-dev=1.2.5-r9

WORKDIR /workspace

ENTRYPOINT ["cargo", "build", "--target=x86_64-unknown-linux-musl", "--locked"]
2 changes: 0 additions & 2 deletions ci/fix-rust-formatting.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM rust:1.88.0-alpine3.21@sha256:9c6a4baf58661f99a5441b15e3ad8295dabf35e849c4935e77ad35d9809be1d2
RUN rustup component add rustfmt

WORKDIR /workspace

ENTRYPOINT ["cargo", "fmt", "--all", "--", "--config=group_imports=StdExternalCrate"]
2 changes: 0 additions & 2 deletions ci/unit-test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ FROM rust:1.88.0-alpine3.21@sha256:9c6a4baf58661f99a5441b15e3ad8295dabf35e849c49
RUN apk add --no-cache \
musl-dev=1.2.5-r9

WORKDIR /workspace

ENTRYPOINT ["cargo", "test", "--verbose", "--target=x86_64-unknown-linux-musl", "--locked"]