Skip to content

Commit 89d977d

Browse files
committed
ci: use slim container for functional tests
1 parent 22e9acd commit 89d977d

File tree

2 files changed

+42
-17
lines changed

2 files changed

+42
-17
lines changed

.github/workflows/build-container.yml

+22-9
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@ name: Build container
22

33
on:
44
workflow_call:
5+
inputs:
6+
context:
7+
description: "Path to use for build context"
8+
required: true
9+
type: string
10+
file:
11+
description: "Path to Dockerfile"
12+
required: true
13+
type: string
14+
name:
15+
description: "Container name"
16+
required: true
17+
type: string
518
outputs:
619
path:
720
description: "Path to built container"
8-
value: ghcr.io/${{ jobs.build.outputs.repo }}/dashcore-ci-runner:${{ jobs.build.outputs.tag }}
21+
value: ghcr.io/${{ jobs.build.outputs.repo }}/${{ inputs.name }}:${{ jobs.build.outputs.tag }}
922

1023
env:
1124
DOCKER_DRIVER: overlay2
@@ -44,15 +57,15 @@ jobs:
4457
- name: Build and push Docker image
4558
uses: docker/build-push-action@v6
4659
with:
47-
context: ./contrib/containers/ci
48-
file: ./contrib/containers/ci/ci.Dockerfile
60+
context: ${{ inputs.context }}
61+
file: ${{ inputs.file }}
4962
push: true
5063
tags: |
51-
ghcr.io/${{ steps.prepare.outputs.repo }}/dashcore-ci-runner:${{ hashFiles('./contrib/containers/ci/ci.Dockerfile') }}
52-
ghcr.io/${{ steps.prepare.outputs.repo }}/dashcore-ci-runner:${{ steps.prepare.outputs.tag }}
53-
ghcr.io/${{ steps.prepare.outputs.repo }}/dashcore-ci-runner:latest
64+
ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}
65+
ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ steps.prepare.outputs.tag }}
66+
ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:latest
5467
cache-from: |
55-
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/dashcore-ci-runner:${{ hashFiles('./contrib/containers/ci/ci.Dockerfile') }}
56-
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/dashcore-ci-runner:${{ steps.prepare.outputs.tag }}
57-
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/dashcore-ci-runner:latest
68+
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}
69+
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ steps.prepare.outputs.tag }}
70+
type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:latest
5871
cache-to: type=inline

.github/workflows/build.yml

+20-8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ jobs:
1616
container:
1717
name: Build container
1818
uses: ./.github/workflows/build-container.yml
19+
with:
20+
context: ./contrib/containers/ci
21+
file: ./contrib/containers/ci/ci.Dockerfile
22+
name: dashcore-ci-runner
23+
24+
container-slim:
25+
name: Build slim container
26+
uses: ./.github/workflows/build-container.yml
27+
with:
28+
context: ./contrib/containers/ci
29+
file: ./contrib/containers/ci/ci-slim.Dockerfile
30+
name: dashcore-ci-slim
1931

2032
depends-arm-linux:
2133
name: arm-linux-gnueabihf
@@ -158,35 +170,35 @@ jobs:
158170
test-linux64:
159171
name: linux64-test
160172
uses: ./.github/workflows/test-src.yml
161-
needs: [container, src-linux64]
173+
needs: [container-slim, src-linux64]
162174
with:
163175
bundle-key: ${{ needs.src-linux64.outputs.key }}
164176
build-target: linux64
165-
container-path: ${{ needs.container.outputs.path }}
177+
container-path: ${{ needs.container-slim.outputs.path }}
166178

167179
test-linux64_nowallet:
168180
name: linux64_nowallet-test
169181
uses: ./.github/workflows/test-src.yml
170-
needs: [container, src-linux64_nowallet]
182+
needs: [container-slim, src-linux64_nowallet]
171183
with:
172184
bundle-key: ${{ needs.src-linux64_nowallet.outputs.key }}
173185
build-target: linux64_nowallet
174-
container-path: ${{ needs.container.outputs.path }}
186+
container-path: ${{ needs.container-slim.outputs.path }}
175187

176188
test-linux64_sqlite:
177189
name: linux64_sqlite-test
178190
uses: ./.github/workflows/test-src.yml
179-
needs: [container, src-linux64_sqlite]
191+
needs: [container-slim, src-linux64_sqlite]
180192
with:
181193
bundle-key: ${{ needs.src-linux64_sqlite.outputs.key }}
182194
build-target: linux64_sqlite
183-
container-path: ${{ needs.container.outputs.path }}
195+
container-path: ${{ needs.container-slim.outputs.path }}
184196

185197
test-linux64_ubsan:
186198
name: linux64_ubsan-test
187199
uses: ./.github/workflows/test-src.yml
188-
needs: [container, src-linux64_ubsan]
200+
needs: [container-slim, src-linux64_ubsan]
189201
with:
190202
bundle-key: ${{ needs.src-linux64_ubsan.outputs.key }}
191203
build-target: linux64_ubsan
192-
container-path: ${{ needs.container.outputs.path }}
204+
container-path: ${{ needs.container-slim.outputs.path }}

0 commit comments

Comments
 (0)