forked from Mcrich23/Container-Compose
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (87 loc) · 2.61 KB
/
tests.yml
File metadata and controls
104 lines (87 loc) · 2.61 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
name: Tests and Release
on:
# Manual trigger only - run via workflow_dispatch
workflow_dispatch:
# Required status check for PRs (but doesn't auto-run on commits)
push:
branches: [main]
paths:
- "Sources/**"
- "Tests/**"
- "Package.swift"
- ".github/workflows/tests.yml"
pull_request:
branches: [main]
paths:
- "Sources/**"
- "Tests/**"
- "Package.swift"
- ".github/workflows/tests.yml"
jobs:
test:
name: Run Swift Static Tests
runs-on: macos-26
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Python dependencies
run: pip install ruamel.yaml
- name: Validate compose YAML (Plan 82 Phase 4)
run: |
# Check for hardcoded IPs in example compose files
python3 scripts/validate-compose-yaml.py \
--check-hardcoded-ips \
--quiet \
examples/*.yml 2>/dev/null || echo "Note: No example files or validation warnings"
- name: Setup Swift
uses: maartene/setup-swift@main
with:
swift-version: "6.2"
- name: Cache Swift dependencies
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build
run: swift build --build-tests
- name: Run static tests
run: swift test --filter Container-Compose-StaticTests.
- name: Upload static test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: .build/debug/*.xctest
if-no-files-found: ignore
build-release:
name: Build Release Binary
runs-on: macos-26
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Swift
uses: maartene/setup-swift@main
with:
swift-version: "6.2"
- name: Cache Swift dependencies
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-release-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-release-
- name: Build Release
run: swift build -c release
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
name: container-compose-release
path: .build/release/container-compose
if-no-files-found: error