forked from kurrent-io/KurrentDB
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (90 loc) · 2.48 KB
/
Copy pathbuild-container-reusable.yml
File metadata and controls
92 lines (90 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Build Container - Reusable
on:
workflow_call:
inputs:
container-runtime:
required: true
type: string
jobs:
build-container:
strategy:
fail-fast: false
runs-on: ubuntu-latest
name: ci/github/build-${{ inputs.container-runtime }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install net8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Variables
id: variables
uses: kanga333/variable-mapper@master
with:
key: "${{ inputs.container-runtime }}"
map: |
{
"jammy": {
"runtime": "linux-x64"
},
"bookworm-slim": {
"runtime": "linux-x64"
},
"alpine": {
"runtime": "linux-musl-x64"
}
}
export_to: output
- name: Build
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: eventstore
build-args: |
CONTAINER_RUNTIME=${{ inputs.container-runtime }}
RUNTIME=${{ steps.variables.outputs.runtime }}
- name: Verify Build
run: |
docker run --rm eventstore --insecure --what-if
- name: Build Test Container
uses: docker/build-push-action@v4
with:
context: .
load: true
target: test
tags: eventstore-test
build-args: |
CONTAINER_RUNTIME=${{ inputs.container-runtime }}
RUNTIME=${{ steps.variables.outputs.runtime }}
- name: Run Tests
run: |
docker run \
--volume $(pwd)/test-results:/build/test-results \
--rm \
eventstore-test
- name: Publish Test Results (HTML)
uses: actions/upload-artifact@v3
if: always()
with:
path: test-results/test-results.html
name: test-results-${{ inputs.container-runtime }}.html
- name: Publish Test Results (All)
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results-${{ inputs.container-runtime }}
path: test-results