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-shell-formatting check-yaml-formatting fix-shell-formatting fix-yaml-formatting check-github-actions-workflows-linting compile unit-test payload
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-clean-git-history
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
21
24
# renovate: depName=mvdan/shfmt
22
- SHFMT_VERSION =v3.12 .0-alpine@sha256:204a4d2d876123342ad394bd9a28fb91e165abc03868790d4b39cfa73233f150
25
+ SHFMT_VERSION =v3.11 .0-alpine@sha256:394d755b6007056a2e6d7537ccdbdcfca01b9855ba91e99df0166ca039c9d422
23
26
27
+ .PHONY : check-shell-formatting
24
28
check-shell-formatting :
25
- docker pull mvdan/shfmt:$(SHFMT_VERSION )
26
- docker run --rm -v $(PWD ) :/workspace -w /workspace -u $(UID ) :$(GID ) mvdan/shfmt:$(SHFMT_VERSION ) --simplify --diff ci/*
29
+ docker run $(DOCKER_RUN_OPTS ) mvdan/shfmt:$(SHFMT_VERSION ) --simplify --diff ./ci/*
27
30
28
- # renovate: depName=ghcr.io/google/yamlfmt
29
- YAMLFMT_VERSION =0.17.2@sha256:fa6874890092db69f35ece6a50e574522cae2a59b6148a1f6ac6d510e5bcf3cc
31
+ YAMLFMT_VERSION =0.17.0@sha256:b4ebf4ff064f5bcf779ef4799dad1fc52542e137677699210aea2de2b270e97f
30
32
33
+ .PHONY : check-yaml-formatting
31
34
check-yaml-formatting :
32
- docker pull ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION )
33
- docker run --rm -v $(PWD ) :/workspace -u $(UID ) :$(GID ) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION ) -verbose -lint -dstar .github/workflows/*
35
+ docker run $(DOCKER_RUN_OPTS ) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION ) -verbose -lint -dstar .github/workflows/*
34
36
37
+ .PHONY : fix-shell-formatting
35
38
fix-shell-formatting :
36
- docker pull mvdan/shfmt:$(SHFMT_VERSION )
37
- docker run --rm -v $(PWD ) :/workspace -w /workspace -u $(UID ) :$(GID ) mvdan/shfmt:$(SHFMT_VERSION ) --simplify --write ci/*
39
+ docker run $(DOCKER_RUN_WRITE_OPTS ) mvdan/shfmt:$(SHFMT_VERSION ) --simplify --write ./ci/*
38
40
41
+ .PHONY : fix-yaml-formatting
39
42
fix-yaml-formatting :
40
- docker pull ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION )
41
- docker run --rm -v $(PWD ) :/workspace -u $(UID ) :$(GID ) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION ) -verbose -dstar .github/workflows/*
43
+ docker run $(DOCKER_RUN_WRITE_OPTS ) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION ) -verbose -dstar .github/workflows/*
42
44
43
45
# renovate: depName=rhysd/actionlint
44
46
ACTIONLINT_VERSION =1.7.7@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9
45
47
48
+ .PHONY : check-github-actions-workflows-linting
46
49
check-github-actions-workflows-linting :
47
- docker pull rhysd/actionlint:$(ACTIONLINT_VERSION )
48
- docker run --rm -v $(PWD ) :/workspace -w /workspace -u $(UID ) :$(GID ) rhysd/actionlint:$(ACTIONLINT_VERSION ) -verbose -color
50
+ docker run $(DOCKER_RUN_OPTS ) rhysd/actionlint:$(ACTIONLINT_VERSION ) -verbose -color
49
51
52
+ .PHONY : compile
50
53
compile :
51
54
docker build -t compile -f ci/compile.Dockerfile .
52
- docker run --rm -v $( PWD ) :/workspace -u $( UID ) : $( GID ) compile
55
+ docker run $( DOCKER_RUN_WRITE_OPTS ) compile
53
56
57
+ .PHONY : unit-test
54
58
unit-test :
55
59
docker build -t unit-test -f ci/unit-test.Dockerfile .
56
- docker run --rm -v $( PWD ) :/workspace -u $( UID ) : $( GID ) unit-test
60
+ docker run $( DOCKER_RUN_WRITE_OPTS ) unit-test
57
61
58
62
PAYLOAD_SOURCE =output.c
59
63
PAYLOAD_OBJECT =output
@@ -63,7 +67,4 @@ payload: $(PAYLOAD_OBJECT)
63
67
./$(PAYLOAD_OBJECT )
64
68
65
69
$(PAYLOAD_OBJECT ) : $(PAYLOAD_SOURCE )
66
- $(CC ) -o $(PAYLOAD_OBJECT ) $(PAYLOAD_SOURCE ) $(PAYLOAD_CFLAGS )
67
-
68
-
69
-
70
+ $(CC ) -o $(PAYLOAD_OBJECT ) $(PAYLOAD_SOURCE ) $(PAYLOAD_CFLAGS )
0 commit comments