Skip to content

Commit a70cac3

Browse files
adrianreberclaude
andcommitted
ci: add OHPC lint container build infrastructure
Add GitHub workflow to build and publish ohpc-lint container to GHCR every Monday or on manual trigger. Include Containerfile for linting tools (codespell, ruff, ShellCheck, shfmt, clang-tools-extra) and local build target in tests/ci/Makefile. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Adrian Reber <[email protected]>
1 parent 70e3695 commit a70cac3

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build and Publish OHPC Lint Container
2+
3+
on:
4+
schedule:
5+
# Run every Monday at 06:00 UTC
6+
- cron: '0 6 * * 1'
7+
workflow_dispatch:
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: openhpc/ohpc-lint
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-24.04
16+
permissions:
17+
contents: read
18+
packages: write
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Log in to Container Registry
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ${{ env.REGISTRY }}
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Extract metadata
34+
id: meta
35+
uses: docker/metadata-action@v5
36+
with:
37+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
tags: |
39+
type=raw,value=latest
40+
type=raw,value={{date 'YYYY-MM-DD'}}
41+
type=sha,prefix={{branch}}-
42+
43+
- name: Build and push container
44+
uses: docker/build-push-action@v6
45+
with:
46+
context: .
47+
file: ./tests/ci/Containerfile.ohpc-lint
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}
51+
platforms: linux/amd64
52+
provenance: false # Disable provenance to avoid unknown/unknown
53+
sbom: false # Disable sbom to avoid unknown/unknown
54+
cache-from: type=gha
55+
cache-to: type=gha,mode=max
56+
57+
- name: Output image details
58+
run: |
59+
echo "Container built and pushed successfully!"
60+
echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
61+
echo "Tags: ${{ steps.meta.outputs.tags }}"

tests/ci/Containerfile.ohpc-lint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM registry.fedoraproject.org/fedora:latest
2+
3+
RUN dnf -y install codespell make ruff ShellCheck shfmt clang-tools-extra git

tests/ci/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,6 @@ clang-format-lint:
289289
../../tests/libs/fftw/tests/*.cpp \
290290
../../tests/libs/trilinos/tests/*.cpp \
291291
../../containers/examples/mpi/mpi.c
292+
293+
build-ohpc-ci:
294+
podman build -f Containerfile.ohpc-lint -t ghcr.io/openhpc/ohpc-lint:latest

0 commit comments

Comments
 (0)