-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (108 loc) · 3.24 KB
/
test.yml
File metadata and controls
121 lines (108 loc) · 3.24 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
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
118
119
120
121
---
name: Test Workflow
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
uses: ./.github/workflows/sdre.yml
name: "Build & Push Latest"
with:
push_enabled: true
ghcr_repo_owner: mikenye
ghcr_repo: ${{ github.repository }}
build_latest: true
build_baseimage_test: false
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
build_test:
uses: ./.github/workflows/sdre.yml
name: "Build & Push Test"
with:
push_enabled: true
ghcr_repo_owner: mikenye
ghcr_repo: ${{ github.repository }}
build_latest: false
build_test: true
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
build_baseimage_test:
uses: ./.github/workflows/sdre.yml
name: "Build & Push Test base image"
with:
push_enabled: true
ghcr_repo_owner: mikenye
ghcr_repo: ${{ github.repository }}
build_latest: false
build_baseimage_test: true
# should not change anything, but why not
build_baseimage_url: :acars-decoder-soapy/:acars-decoder-soapy-test-pr
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
populate_cache:
name: "Populate cache"
runs-on: ubuntu-24.04
steps:
# Check out code
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: "Make some data to cache"
run: |
mkdir -p ./cache
dd if=/dev/zero of=./cache/data bs=4k count=50
ls -la ./cache/data
# Populate cache
- name: "Populate cache"
id: populate_cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ./cache
key: ${{ github.run_id }}
check_cache:
name: "Check cache"
needs: [populate_cache]
uses: ./.github/workflows/sdre.yml
with:
push_enabled: false
build_latest: true
ghcr_repo_owner: mikenye
ghcr_repo: ${{ github.repository }}
cache_enabled: true
cache_path: ./cache
cache_key: ${{ github.run_id }}
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
all_tests_passed:
name: All tests passed
runs-on: ubuntu-latest
needs:
- build
- build_test
- build_baseimage_test
- populate_cache
- check_cache
if: always()
steps:
- name: Verify all required jobs succeeded
run: |
echo "build: ${{ needs.build.result }}"
echo "build_test: ${{ needs.build_test.result }}"
echo "build_baseimage_test: ${{ needs.build_baseimage_test.result }}"
echo "populate_cache: ${{ needs.populate_cache.result }}"
echo "check_cache: ${{ needs.check_cache.result }}"
if [[ "${{ needs.build.result }}" != "success" ]] ||
[[ "${{ needs.build_test.result }}" != "success" ]] ||
[[ "${{ needs.build_baseimage_test.result }}" != "success" ]] ||
[[ "${{ needs.populate_cache.result }}" != "success" ]] ||
[[ "${{ needs.check_cache.result }}" != "success" ]]; then
echo "❌ One or more jobs failed"
exit 1
fi
echo "✅ All jobs succeeded"