Skip to content

Commit e818211

Browse files
committed
ci: adding Makefile Renovate updating
1 parent f23c8ee commit e818211

File tree

5 files changed

+54
-26
lines changed

5 files changed

+54
-26
lines changed

.github/renovate.json renamed to .github/renovate.json5

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@
3636
"datasourceTemplate": "repology",
3737
"depNameTemplate": "alpine_{{alpineMajor}}_{{alpineMinor}}/{{name}}",
3838
"versioningTemplate": "loose"
39+
},
40+
{
41+
"customType": "regex",
42+
"managerFilePatterns": [
43+
"/(^|/|\\.)Makefile$/",
44+
"/(^|/)Makefile[^/]*$/"
45+
],
46+
"matchStrings": [
47+
"# renovate: depName=(?<depName>.*?)\\s.+_VERSION=(?<currentValue>[a-z0-9.-]+)(?:@(?<currentDigest>sha256:[a-f0-9]+))?"
48+
],
49+
"datasourceTemplate": "docker",
50+
"versioningTemplate": "docker"
3951
}
4052
]
4153
}

.github/workflows/continuous-integration.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@ name: Continuous Integration (CI)
22

33
on: pull_request
44

5-
env:
6-
# Forcing Earthly to use colours, to make reading output easier.
7-
FORCE_COLOR: 1
8-
95
jobs:
6+
formatting:
7+
name: Formatting
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
language: [shell]
12+
steps:
13+
- name: Checkout code.
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
- name: Check formatting.
16+
run: make check-${{ matrix.language }}-formatting
1017
compile:
1118
name: Compile
1219
runs-on: ubuntu-latest
1320
steps:
14-
- name: Download Earthly.
15-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
16-
with:
17-
version: v0.8.15
1821
- name: Checkout code.
1922
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2023
- name: Compile.
@@ -23,10 +26,6 @@ jobs:
2326
name: Unit Test
2427
runs-on: ubuntu-latest
2528
steps:
26-
- name: Download Earthly.
27-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
28-
with:
29-
version: v0.8.15
3029
- name: Checkout code.
3130
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3231
- name: Unit Test.

Makefile

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
UID := $(shell id -u)
33
GID := $(shell id -g)
44

5-
.PHONY: check-clean-git-history check-conventional-commits-linting check-yaml-formatting fix-yaml-formatting check-github-actions-workflows-linting compile unit-test payload
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
66

77
check-clean-git-history:
88
docker build -t check-clean-git-history -f ci/check-clean-git-history.Dockerfile .
@@ -12,17 +12,34 @@ check-conventional-commits-linting:
1212
docker build -t check-conventional-commits-linting -f ci/check-conventional-commits-linting.Dockerfile .
1313
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) check-conventional-commits-linting $(FROM)
1414

15+
# renovate: depName=mvdan/shfmt
16+
SHFMT_VERSION=v3.11.0-alpine@sha256:394d755b6007056a2e6d7537ccdbdcfca01b9855ba91e99df0166ca039c9d422
17+
18+
check-shell-formatting:
19+
docker pull mvdan/shfmt:$(SHFMT_VERSION)
20+
docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) mvdan/shfmt:$(SHFMT_VERSION) --simplify --diff ci/*
21+
22+
# renovate: depName=ghcr.io/google/yamlfmt
23+
YAMLFMT_VERSION=0.17.0@sha256:b4ebf4ff064f5bcf779ef4799dad1fc52542e137677699210aea2de2b270e97f
24+
1525
check-yaml-formatting:
16-
docker pull ghcr.io/google/yamlfmt:0.17.0
17-
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:0.17.0 -verbose -lint -dstar .github/workflows/*
26+
docker pull ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION)
27+
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -lint -dstar .github/workflows/*
28+
29+
fix-shell-formatting:
30+
docker pull mvdan/shfmt:$(SHFMT_VERSION)
31+
docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) mvdan/shfmt:$(SHFMT_VERSION) --simplify --write ci/*
1832

1933
fix-yaml-formatting:
20-
docker pull ghcr.io/google/yamlfmt:0.17.0
21-
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:0.17.0 -verbose -dstar .github/workflows/*
34+
docker pull ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION)
35+
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:$(YAMLFMT_VERSION) -verbose -dstar .github/workflows/*
36+
37+
# renovate: depName=rhysd/actionlint
38+
ACTIONLINT_VERSION=1.7.7@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9
2239

2340
check-github-actions-workflows-linting:
24-
docker pull rhysd/actionlint:1.7.7
25-
docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) rhysd/actionlint:1.7.7 -verbose -color
41+
docker pull rhysd/actionlint:$(ACTIONLINT_VERSION)
42+
docker run --rm -v $(PWD):/workspace -w /workspace -u $(UID):$(GID) rhysd/actionlint:$(ACTIONLINT_VERSION) -verbose -color
2643

2744
compile:
2845
docker build -t compile -f ci/compile.Dockerfile .

ci/compile.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
FROM alpine:3.22.0@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be023728e11715
22

33
RUN apk add --no-cache \
4-
gcc=14.2.0-r6 \
5-
build-base=0.5-r3
4+
gcc=14.2.0-r6 \
5+
build-base=0.5-r3
66

77
WORKDIR /workspace
88

9-
ENTRYPOINT ["gcc", "-o", "shellcode-generator", "src/shellcode-generator.c"]
9+
ENTRYPOINT ["gcc", "-o", "shellcode-generator", "src/shellcode-generator.c"]

ci/unit-test.Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM alpine:3.22.0@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be023728e11715
22

33
RUN apk add --no-cache \
4-
gcc=14.2.0-r6 \
5-
build-base=0.5-r3 \
6-
cunit-dev=2.1.3-r7
4+
gcc=14.2.0-r6 \
5+
build-base=0.5-r3 \
6+
cunit-dev=2.1.3-r7
77

88
WORKDIR /workspace
99

10-
ENTRYPOINT ["gcc", "-o", "shellcode-generator-tests", "tests/shellcode-generator-tests.c", "-lcunit"]
10+
ENTRYPOINT ["gcc", "-o", "shellcode-generator-tests", "tests/shellcode-generator-tests.c", "-lcunit"]

0 commit comments

Comments
 (0)