forked from MiczFlor/RPi-Jukebox-RFID
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (97 loc) · 3.34 KB
/
docker_bullseye_unified.yml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Test Install Scripts Target Unified
# let only one instance run the test so cache is not corrupted.
# cancel already running instances as only the last run will be relevant
concurrency:
group: ${{ github.ref }}-unified
cancel-in-progress: true
on:
schedule:
# run at 5 every sunday
- cron: '0 5 * * 0'
push:
branches-ignore:
- 'future3/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
workflow_dispatch:
env:
DOCKER_IMAGE_NAME: rpi-jukebox-rfid-bullseye
_PATH_DOCKER_IMAGE_TAR: /tmp/rpi-jukebox-rfid-bullseye.tar
CACHE_SCOPE: ${{ github.ref }}-unified
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Build Bullseye ARMv7
uses: docker/build-push-action@v5
with:
context: .
load: false
push: false
file: ./ci/Dockerfile.bullseye.test_install_unified.armv7
target: test
platforms: linux/arm/v7
tags: local/${{ env.DOCKER_IMAGE_NAME }}:cache
cache-from: type=gha,scope=${{ env.CACHE_SCOPE }}
cache-to: type=gha,mode=max,scope=${{ env.CACHE_SCOPE }}
- name: Build Bullseye ARMv7 - Update
uses: docker/build-push-action@v5
with:
context: .
load: false
push: false
file: ./ci/Dockerfile.bullseye.test_install_unified.armv7
target: test-update
platforms: linux/arm/v7
tags: local/${{ env.DOCKER_IMAGE_NAME }}:cache
cache-from: type=gha,scope=${{ env.CACHE_SCOPE }}
outputs: type=docker,dest=${{ env._PATH_DOCKER_IMAGE_TAR }}
- name: Cache Check Docker Image
uses: actions/cache/restore@v3
id: cache-restore
with:
lookup-only: true
key: ${{ env.DOCKER_IMAGE_NAME }}-${{ hashFiles( env._PATH_DOCKER_IMAGE_TAR ) }}
path: ${{ env._PATH_DOCKER_IMAGE_TAR }}
- name: Cache Save Docker Image
uses: actions/cache/save@v3
if: ${{ ! steps.cache-restore.outputs.cache-hit }}
with:
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
path: ${{ env._PATH_DOCKER_IMAGE_TAR }}
test:
needs: prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_Script: [run_installation_tests.sh, run_installation_tests2.sh, run_installation_tests3.sh]
username: [pi, hans]
steps:
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Cache Restore Docker Image
uses: actions/cache/restore@v3
with:
key: ${{ env.DOCKER_IMAGE_NAME }}-${{ hashFiles( env._PATH_DOCKER_IMAGE_TAR ) }}
path: ${{ env._PATH_DOCKER_IMAGE_TAR }}
fail-on-cache-miss: true
- name: Load Docker Image
run: |
docker load --input ${{ env._PATH_DOCKER_IMAGE_TAR }}
- name: Run ${{ matrix.test_Script }} Bullseye ARMv7
uses: tj-actions/docker-run@v2
with:
image: local/${{ env.DOCKER_IMAGE_NAME }}:cache
options: --platform linux/arm/v7 --user ${{ matrix.username }}
name: ${{ matrix.test_Script }}
args: |
./${{ matrix.test_Script }}