-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (104 loc) · 3.25 KB
/
Copy pathapi-coverage.yml
File metadata and controls
122 lines (104 loc) · 3.25 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
122
#
# api-coverage.yml
# umc-product-iOS
#
# Created by euijjang97 on 4/29/26.
#
name: API Coverage
on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
push:
branches: [ "develop" ]
paths:
- "Stella/**"
- "AppProduct/**/Router/**"
- "UMCApp/Features/**/Data/**/Router/**"
- ".github/workflows/api-coverage.yml"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: api-coverage
cancel-in-progress: false
jobs:
scan:
name: Scan & render
runs-on: macos-26
defaults:
run:
working-directory: Stella
outputs:
pages-artifact: ${{ steps.upload-pages.outputs.artifact_id }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Select Xcode 26.4+
run: |
XCODE_PATH=$(ls -d /Applications/Xcode_26.4*.app 2>/dev/null | sort -V | tail -n 1)
if [ -z "$XCODE_PATH" ]; then
echo "Xcode 26.4+ not found on runner. Available:"
ls -d /Applications/Xcode_*.app 2>/dev/null || true
exit 1
fi
echo "Selecting $XCODE_PATH"
sudo xcode-select -s "$XCODE_PATH/Contents/Developer"
xcodebuild -version
- name: Cache SwiftPM build artifacts
uses: actions/cache@v4
with:
path: |
Stella/.build
~/Library/Caches/org.swift.swiftpm
key: ${{ runner.os }}-spm-apicov-${{ hashFiles('Stella/Package.resolved', 'Stella/Package.swift') }}
restore-keys: |
${{ runner.os }}-spm-apicov-
- name: Build apicov
run: swift build -c release --product apicov
- name: Run scan
env:
UMC_API_USER: ${{ secrets.UMC_API_USER }}
UMC_API_PASS: ${{ secrets.UMC_API_PASS }}
run: |
set -euo pipefail
extra=()
[ -f authors.yml ] && extra+=("--authors" "authors.yml")
[ -f overrides.yml ] && extra+=("--overrides" "overrides.yml")
[ -f owners.yml ] && extra+=("--owners" "owners.yml")
.build/release/apicov scan \
--openapi-url https://dev.api.umc.it.kr/docs-json \
--auth-env UMC_API_USER:UMC_API_PASS \
--app-product ../AppProduct \
--umc-app ../UMCApp \
--blame-root .. \
--out coverage.json \
${extra[@]+"${extra[@]}"}
- name: Render HTML report
run: |
mkdir -p _site
.build/release/apicov report coverage.json --out _site/index.html
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-snapshot
path: Stella/coverage.json
retention-days: 30
- name: Upload Pages artifact
id: upload-pages
uses: actions/upload-pages-artifact@v3
with:
path: Stella/_site
deploy:
name: Deploy to GitHub Pages
needs: scan
if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4