-
Notifications
You must be signed in to change notification settings - Fork 7
48 lines (40 loc) · 1.4 KB
/
container-test.yml
File metadata and controls
48 lines (40 loc) · 1.4 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
name: "Container build and test"
on:
workflow_call:
permissions:
contents: read
env:
REGISTRY: localhost
NAME: utility-container
TAG: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || (github.ref_name == 'main' && 'latest' || github.ref_name) }}
jobs:
podman-build:
name: Utility Container Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Download AMD64 image
uses: actions/download-artifact@v8
with:
name: image-amd64-${{ github.run_id }}
path: /tmp
- name: Load tarballs into local containers-storage
env:
CONTAINER: ${{ env.NAME }}:${{ env.TAG }}
run: |
buildah pull docker-archive:/tmp/image-amd64.tar
make manifest
buildah manifest add --arch=amd64 "${REGISTRY}/${CONTAINER}" "${REGISTRY}/${CONTAINER}-amd64"
- name: Run Container tests
run: make test-amd64
- name: Clone MCG and test a target via container
env:
CONTAINER: ${{ env.NAME }}:${{ env.TAG }}
run: |
git clone --depth 1 https://github.com/validatedpatterns/multicloud-gitops
cd multicloud-gitops
export PATTERN_UTILITY_CONTAINER="${REGISTRY}/${CONTAINER}-amd64"
./pattern.sh make validate-schema