Skip to content

Commit ef82c0b

Browse files
committed
added pull_request_template.md and uploading logs to ci docker creation
1 parent cf478c8 commit ef82c0b

3 files changed

Lines changed: 83 additions & 12 deletions

File tree

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
name: Feature request
3-
about: Suggest an idea for this project
2+
name: Pull Request Template
3+
about: Pull Request Template
44
title: ''
55
labels: ''
66
assignees: ''
77

88
---
99

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1210

13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
11+
**Description**
1512

16-
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
13+
- Summary of the changes proposed in the pull request.
14+
- Include screenshots if applicable.
15+
16+
**Related issue(s)**
17+
18+
- A reference to a related issue in your repository.
1819

1920
**Additional context**
20-
Add any other context or screenshots about the feature request here.
21+
22+
- Add any other context about the pull request here.
23+
- @mentions of the person or team responsible for reviewing proposed changes.

.github/pull_request_template.md

Whitespace-only changes.

.github/workflows/docker.yml

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: GHCR Images
44
on:
55
push:
66
branches: [ main ] # publish on main updates
7-
tags: [ 'v*' ] # (optional) also publish on repo tags
7+
tags: [ 'v*' ] # (optional) also publish on repo tags
88
pull_request: # PRs: build only (no push)
99

1010
concurrency:
@@ -18,7 +18,7 @@ jobs:
1818
# Expose the step outputs to downstream jobs
1919
outputs:
2020
matrix: ${{ steps.scan.outputs.matrix }}
21-
image: ${{ steps.scan.outputs.image }}
21+
image: ${{ steps.scan.outputs.image }}
2222
steps:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
@@ -28,7 +28,7 @@ jobs:
2828
# - image : "ghcr.io/<owner>/gemc"
2929
- id: scan
3030
name: Build matrix
31-
run: ci/discover-docker-matrix.zsh
31+
run: ci/discover-docker-matrix.sh
3232

3333
build:
3434
name: Build ${{ matrix.tag }} on ${{ matrix.os }}
@@ -88,3 +88,71 @@ jobs:
8888
labels: ${{ steps.meta.outputs.labels }}
8989
cache-from: type=gha
9090
cache-to: type=gha,mode=max
91+
92+
# Build for PRs: single-arch, load into local Docker so we can copy logs out
93+
- name: Build (PR) [load locally]
94+
if: ${{ github.event_name == 'pull_request' }}
95+
uses: docker/build-push-action@v6
96+
with:
97+
context: .
98+
file: ${{ matrix.file }}
99+
platforms: linux/amd64 # load:true only supports single arch
100+
load: true # <-- makes the image available locally
101+
push: false
102+
tags: ${{ steps.meta.outputs.tags }}
103+
labels: ${{ steps.meta.outputs.labels }}
104+
cache-from: type=gha
105+
cache-to: type=gha,mode=max
106+
107+
# Build & push for main/tags: multi-arch & publish to GHCR
108+
- name: Build & Push (main/tags)
109+
if: ${{ github.event_name != 'pull_request' }}
110+
uses: docker/build-push-action@v6
111+
with:
112+
context: .
113+
file: ${{ matrix.file }}
114+
platforms: linux/amd64,linux/arm64
115+
push: true
116+
tags: ${{ steps.meta.outputs.tags }}
117+
labels: ${{ steps.meta.outputs.labels }}
118+
cache-from: type=gha
119+
cache-to: type=gha,mode=max
120+
121+
# Extract logs from the built image (local on PRs, pull on main/tags)
122+
- name: Extract /root/src/logs from image
123+
if: ${{ always() }}
124+
env:
125+
IMG: ${{ needs.discover.outputs.image }}:gemc-${{ matrix.tag }}-${{ matrix.os }}
126+
run: |
127+
set -euo pipefail
128+
mkdir -p ci-logs
129+
130+
# If image isn't local (e.g., main build), try pulling it
131+
if ! docker image inspect "$IMG" >/dev/null 2>&1; then
132+
echo "Image not local; attempting docker pull (PRs will skip)…"
133+
docker pull "$IMG" || true
134+
fi
135+
136+
if docker image inspect "$IMG" >/dev/null 2>&1; then
137+
cid="$(docker create "$IMG" true || true)"
138+
if [ -n "${cid:-}" ]; then
139+
docker cp "$cid":/root/src/logs/. ci-logs/ 2>/dev/null || true
140+
docker rm -v "$cid" >/dev/null 2>&1 || true
141+
fi
142+
else
143+
echo "Image unavailable (likely build failed before image existed)."
144+
fi
145+
146+
ls -l ci-logs || true
147+
148+
- name: Upload build logs artifact
149+
if: ${{ always() }}
150+
uses: actions/upload-artifact@v4
151+
with:
152+
name: logs-${{ matrix.tag }}-${{ matrix.os }}
153+
path: |
154+
ci-logs/setup.log
155+
ci-logs/build.log
156+
ci-logs/test.log
157+
if-no-files-found: ignore
158+
retention-days: 14

0 commit comments

Comments
 (0)