-
Notifications
You must be signed in to change notification settings - Fork 227
82 lines (70 loc) · 2.58 KB
/
Copy pathbigendian.yaml
File metadata and controls
82 lines (70 loc) · 2.58 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
name: Test bigendian
permissions: {}
on:
push:
branches: [backport-1.x]
pull_request:
branches: [backport-1.x]
workflow_dispatch:
jobs:
bigendian:
name: Run tests on bigendian s390x system
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
# driver must be docker, likely related to https://github.com/moby/buildkit/issues/2343
driver: docker
- name: Set caching parameters
run: |
dockerfile_sha=$(sha1sum .github/images/bigendian.Dockerfile| head -c 40)
echo "DOCKERFILE_SHA=$dockerfile_sha" >> $GITHUB_ENV
echo "S390X_CACHE_DIR=~/s390x_image" >> $GITHUB_ENV
echo "S390X_CACHE_FILE=s390x.tar" >> $GITHUB_ENV
echo "S390X_IMAGE_TAG=s390x:$dockerfile_sha" >> $GITHUB_ENV
- name: Make s390x cache directory
run: mkdir -p ${{ env.S390X_CACHE_DIR }}
- name: Check for s390x cache
uses: actions/cache@v4
id: s390x-cache
with:
path: ${{ env.S390X_CACHE_DIR }}
key: s390x-cache-${{ env.DOCKERFILE_SHA }}
- if: steps.s390x-cache.outputs.cache-hit != 'true'
name: Build s390x image
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: .github/images/bigendian.Dockerfile
load: true
platforms: linux/s390x
target: s390x_base
tags: ${{ env.S390X_IMAGE_TAG }}
- if: steps.s390x-cache.outputs.cache-hit != 'true'
name: Save built s390x image
run: |
echo "s390x image from dockerfile with sha ${{ env.DOCKERFILE_SHA }} not found in cache"
echo "made s390x image with tag: ${{ env.S390X_IMAGE_TAG }}"
docker save -o ${{ env.S390X_CACHE_DIR }}/${{ env.S390X_CACHE_FILE }} ${{ env.S390X_IMAGE_TAG }}
- if: steps.s390x-cache.outputs.cache-hit == 'true'
name: Load s390x image
run: |
ls ${{ env.S390X_CACHE_DIR }}
docker load -i ${{ env.S390X_CACHE_DIR }}/${{ env.S390X_CACHE_FILE }}
- name: Build
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
build-args: |
S390X_BASE_IMAGE=${{ env.S390X_IMAGE_TAG }}
context: .
file: .github/images/bigendian.Dockerfile
platforms: linux/s390x
target: tester