|
1 | | -# So new files are owned by the user. |
| 1 | +DOCKER_RUN_OPTS := --rm -v $(PWD):/workspace -w /workspace |
| 2 | + |
2 | 3 | UID := $(shell id -u) |
3 | 4 | GID := $(shell id -g) |
| 5 | +DOCKER_RUN_WRITE_OPTS := $(DOCKER_RUN_OPTS) -u $(UID):$(GID) |
4 | 6 |
|
5 | | -.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 |
| 7 | +.PHONY: default |
| 8 | +default: compile |
6 | 9 |
|
7 | 10 | # renovate: depName=ghcr.io/developerc286/clean_git_history |
8 | 11 | CLEAN_GIT_HISTORY_VERSION=1.0.4@sha256:5783341a3377a723e409e72b9ec0826a75ba944288d030978355de05ef65b186 |
9 | 12 |
|
| 13 | +.PHONY: check-clean-git-history |
10 | 14 | check-clean-git-history: |
11 | | - docker pull ghcr.io/developerc286/clean_git_history:$(CLEAN_GIT_HISTORY_VERSION) |
12 | | - docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/developerc286/clean_git_history:$(CLEAN_GIT_HISTORY_VERSION) $(FROM) |
| 15 | + docker run $(DOCKER_RUN_WRITE_OPTS) ghcr.io/developerc286/clean_git_history:$(CLEAN_GIT_HISTORY_VERSION) $(FROM) |
13 | 16 |
|
14 | 17 | # renovate: depName=ghcr.io/developerc286/conventional_commits_linter |
15 | 18 | CONVENTIONAL_COMMITS_LINTER_VERSION=0.15.0@sha256:b631a3cdcbed28c8938a2a6b63e16ecfd0d7ff71c28e878815adf9183e1fb599 |
16 | 19 |
|
| 20 | +.PHONY: check-conventional-commits-linting |
17 | 21 | check-conventional-commits-linting: |
18 | | - docker pull ghcr.io/developerc286/conventional_commits_linter:$(CONVENTIONAL_COMMITS_LINTER_VERSION) |
19 | | - docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/developerc286/conventional_commits_linter:$(CONVENTIONAL_COMMITS_LINTER_VERSION) --allow-angular-type-only $(FROM) |
| 22 | + docker run $(DOCKER_RUN_WRITE_OPTS) ghcr.io/developerc286/conventional_commits_linter:$(CONVENTIONAL_COMMITS_LINTER_VERSION) --allow-angular-type-only $(FROM) |
20 | 23 |
|
| 24 | +.PHONY: check-rust-formatting |
21 | 25 | check-rust-formatting: |
22 | 26 | docker build -t check-rust-formatting -f ci/check-rust-formatting.Dockerfile . |
23 | | - docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) check-rust-formatting |
| 27 | + docker run $(DOCKER_RUN_OPTS) check-rust-formatting |
24 | 28 |
|
25 | 29 | # renovate: depName=mvdan/shfmt |
26 | 30 | SHFMT_VERSION=v3.11.0-alpine@sha256:394d755b6007056a2e6d7537ccdbdcfca01b9855ba91e99df0166ca039c9d422 |
27 | 31 |
|
| 32 | +.PHONY: check-shell-formatting |
28 | 33 | check-shell-formatting: |
29 | | - docker pull mvdan/shfmt:$(SHFMT_VERSION) |
30 | | - docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) mvdan/shfmt:$(SHFMT_VERSION) --simplify --diff ci/* |
| 34 | + docker run $(DOCKER_RUN_OPTS) mvdan/shfmt:$(SHFMT_VERSION) --simplify --diff ci/* |
31 | 35 |
|
32 | 36 | # renovate: depName=ghcr.io/google/yamlfmt |
33 | 37 | YAMLFMT_VERSION=0.17.2@sha256:fa6874890092db69f35ece6a50e574522cae2a59b6148a1f6ac6d510e5bcf3cc |
34 | 38 |
|
| 39 | +.PHONY: check-yaml-formatting |
35 | 40 | check-yaml-formatting: |
36 | | - docker pull ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) |
37 | | - docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -lint -dstar .github/workflows/* |
| 41 | + docker run $(DOCKER_RUN_OPTS) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -lint -dstar .github/workflows/* |
38 | 42 |
|
| 43 | +.PHONY: fix-rust-formatting |
39 | 44 | fix-rust-formatting: |
40 | 45 | docker build -t fix-rust-formatting -f ci/fix-rust-formatting.Dockerfile . |
41 | | - docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) fix-rust-formatting |
| 46 | + docker run $(DOCKER_RUN_WRITE_OPTS) fix-rust-formatting |
42 | 47 |
|
| 48 | +.PHONY: fix-shell-formatting |
43 | 49 | fix-shell-formatting: |
44 | | - docker pull mvdan/shfmt:$(SHFMT_VERSION) |
45 | | - docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) mvdan/shfmt:$(SHFMT_VERSION) --simplify --write ci/* |
| 50 | + docker run $(DOCKER_RUN_WRITE_OPTS) mvdan/shfmt:$(SHFMT_VERSION) --simplify --write ci/* |
46 | 51 |
|
| 52 | +.PHONY: fix-yaml-formatting |
47 | 53 | fix-yaml-formatting: |
48 | | - docker pull ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) |
49 | | - docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -dstar .github/workflows/* |
| 54 | + docker run $(DOCKER_RUN_WRITE_OPTS) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -dstar .github/workflows/* |
50 | 55 |
|
| 56 | +.PHONY: check-rust-linting |
51 | 57 | check-rust-linting: |
52 | 58 | docker build -t check-rust-linting -f ci/check-rust-linting.Dockerfile . |
53 | | - docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) check-rust-linting |
| 59 | + docker run $(DOCKER_RUN_OPTS) check-rust-linting |
54 | 60 |
|
55 | 61 | # renovate: depName=rhysd/actionlint |
56 | 62 | ACTIONLINT_VERSION=1.7.7@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9 |
57 | 63 |
|
| 64 | +.PHONY: check-github-actions-workflows-linting |
58 | 65 | check-github-actions-workflows-linting: |
59 | | - docker pull rhysd/actionlint:$(ACTIONLINT_VERSION) |
60 | | - docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) rhysd/actionlint:$(ACTIONLINT_VERSION) -verbose -color |
| 66 | + docker run $(DOCKER_RUN_WRITE_OPTS) rhysd/actionlint:$(ACTIONLINT_VERSION) -verbose -color |
61 | 67 |
|
| 68 | +.PHONY: compile |
62 | 69 | compile: |
63 | 70 | docker build -t compile -f ci/compile.Dockerfile . |
64 | | - docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) compile |
| 71 | + docker run $(DOCKER_RUN_WRITE_OPTS) compile |
65 | 72 |
|
| 73 | +.PHONY: unit-test |
66 | 74 | unit-test: |
67 | 75 | docker build -t unit-test -f ci/unit-test.Dockerfile . |
68 | | - docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) unit-test |
| 76 | + docker run $(DOCKER_RUN_WRITE_OPTS) unit-test |
0 commit comments