forked from IceWhaleTech/CasaOS-AppStore
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (89 loc) · 3.12 KB
/
Copy pathvalidator.yml
File metadata and controls
99 lines (89 loc) · 3.12 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
name: Validate Compose And Build
on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
inputs:
app_path:
description: "Optional app folder name under Apps/ (e.g. 2FAuth). Leave empty to validate all."
required: false
default: ""
jobs:
validate:
runs-on: ubuntu-latest
env:
BUILD_CACHE_KEY: build-appstore-cache-${{ github.ref_name }}-${{ github.run_id }}
BUILD_CACHE_PREFIX: build-appstore-cache-${{ github.ref_name }}-
steps:
- uses: actions/checkout@v6
- name: Validate compose metadata
id: validate_compose
continue-on-error: true
uses: ./.github/actions/validate-compose
with:
app-path: ${{ inputs.app_path }}
report-json: out/validation-report.json
- name: Upload validation report artifacts
if: always()
uses: actions/upload-artifact@v6
with:
name: validation-report
path: |
out/validation-report.json
- name: Restore build caches
uses: actions/cache/restore@v5
with:
path: |
.cache/build_appstore/image-size-cache.json
.cache/build_appstore/image-digest-cache.json
key: ${{ env.BUILD_CACHE_KEY }}
restore-keys: |
${{ env.BUILD_CACHE_PREFIX }}
- name: Validate appstore build
id: validate_build
continue-on-error: true
uses: ./.github/actions/build-store-v2
with:
source: .
output: /tmp/appstore-dist
base-url: https://cdn.jsdelivr.net/gh/${{ github.repository }}@gh-pages
cache-file: .cache/build_appstore/image-size-cache.json
digest-cache-file: .cache/build_appstore/image-digest-cache.json
report-json: out/build-v2-validation-report.json
report-title: Validation Build Report
- name: Upload build validation report artifacts
if: always()
uses: actions/upload-artifact@v6
with:
name: build-v2-validation-report
path: |
out/build-v2-validation-report.json
- name: Save build caches
if: always()
uses: actions/cache/save@v5
with:
path: |
.cache/build_appstore/image-size-cache.json
.cache/build_appstore/image-digest-cache.json
key: ${{ env.BUILD_CACHE_KEY }}
- name: Write validation job summary
if: always()
uses: ./.github/actions/write-job-summary
with:
title: Validation Summary
report-jsons: |
out/validation-report.json
out/build-v2-validation-report.json
- name: Fail workflow if validation failed
if: always()
shell: bash
run: |
set -euo pipefail
if [ "${{ steps.validate_compose.outcome }}" != "success" ]; then
echo "Compose validation failed. See validation-report artifact."
exit 1
fi
if [ "${{ steps.validate_build.outcome }}" != "success" ]; then
echo "AppStore build validation failed. See workflow logs."
exit 1
fi