Skip to content

ci: adding Makefile Renovate updating #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
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
12 changes: 12 additions & 0 deletions .github/renovate.json → .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@
"datasourceTemplate": "repology",
"depNameTemplate": "alpine_{{alpineMajor}}_{{alpineMinor}}/{{name}}",
"versioningTemplate": "loose"
},
{
"customType": "regex",
"managerFilePatterns": [
"/(^|/|\\.)Makefile$/",
"/(^|/)Makefile[^/]*$/"
],
"matchStrings": [
"# renovate: depName=(?<depName>.*?)\\s.+_VERSION=(?<currentValue>[a-z0-9.-]+)(?:@(?<currentDigest>sha256:[a-f0-9]+))?"
],
"datasourceTemplate": "docker",
"versioningTemplate": "docker"
}
]
}
23 changes: 11 additions & 12 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ name: Continuous Integration (CI)

on: pull_request

env:
# Forcing Earthly to use colours, to make reading output easier.
FORCE_COLOR: 1

jobs:
formatting:
name: Formatting
runs-on: ubuntu-latest
strategy:
matrix:
language: [shell]
steps:
- name: Checkout code.
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check formatting.
run: make check-${{ matrix.language }}-formatting
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- name: Download Earthly.
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
with:
version: v0.8.15
- name: Checkout code.
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Compile.
Expand All @@ -23,10 +26,6 @@ jobs:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Download Earthly.
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
with:
version: v0.8.15
- name: Checkout code.
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Unit Test.
Expand Down
31 changes: 24 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
UID := $(shell id -u)
GID := $(shell id -g)

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

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

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

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/*

# renovate: depName=ghcr.io/google/yamlfmt
YAMLFMT_VERSION=0.17.0@sha256:b4ebf4ff064f5bcf779ef4799dad1fc52542e137677699210aea2de2b270e97f

check-yaml-formatting:
docker pull ghcr.io/google/yamlfmt:0.17.0
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:0.17.0 -verbose -lint -dstar .github/workflows/*
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/*

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/*

fix-yaml-formatting:
docker pull ghcr.io/google/yamlfmt:0.17.0
docker run --rm -v $(PWD):/workspace -u $(UID):$(GID) ghcr.io/google/yamlfmt:0.17.0 -verbose -dstar .github/workflows/*
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/*

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

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

compile:
docker build -t compile -f ci/compile.Dockerfile .
Expand Down
6 changes: 3 additions & 3 deletions ci/compile.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM alpine:3.22.0@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be023728e11715

RUN apk add --no-cache \
gcc=14.2.0-r6 \
build-base=0.5-r3
gcc=14.2.0-r6 \
build-base=0.5-r3

WORKDIR /workspace

ENTRYPOINT ["gcc", "-o", "shellcode-generator", "src/shellcode-generator.c"]
ENTRYPOINT ["gcc", "-o", "shellcode-generator", "src/shellcode-generator.c"]
8 changes: 4 additions & 4 deletions ci/unit-test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM alpine:3.22.0@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be023728e11715

RUN apk add --no-cache \
gcc=14.2.0-r6 \
build-base=0.5-r3 \
cunit-dev=2.1.3-r7
gcc=14.2.0-r6 \
build-base=0.5-r3 \
cunit-dev=2.1.3-r7

WORKDIR /workspace

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