-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (80 loc) · 2.47 KB
/
Copy pathprivate-trigger.yml
File metadata and controls
88 lines (80 loc) · 2.47 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
name: Trigger Docker Build
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
jobs:
# Run Flutter tests
flutter-test:
runs-on: [self-hosted]
defaults:
run:
working-directory: lam7a
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.0'
channel: 'stable'
cache: true
- name: Get dependencies
run: flutter pub get
- name: Cache generated files
uses: actions/cache@v4
with:
path: |
lam7a/**/*.g.dart
lam7a/**/*.freezed.dart
key: ${{ runner.os }}-generated-${{ hashFiles('lam7a/pubspec.lock', 'lam7a/lib/**/*.dart') }}
restore-keys: |
${{ runner.os }}-generated-
- name: Run builder
run: dart run build_runner build --delete-conflicting-outputs
- name: Run analysis (errors only)
run: |
flutter analyze > analyze_output.txt 2>&1 || true
if grep -q "^error •" analyze_output.txt; then
echo "❌ Found compilation errors:"
grep "^error •" analyze_output.txt
exit 1
else
echo "✅ No compilation errors found"
fi
- name: Run tests with coverage
run: flutter test --coverage
continue-on-error: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./lam7a/coverage/lcov.info
flags: flutter
name: flutter-coverage
fail_ci_if_error: false
# Trigger the public workflow
trigger-public-workflow:
needs: flutter-test
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Trigger public repo workflow
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.PAT_GITHUB }}" \
https://api.github.com/repos/karimfaridz/runner/dispatches \
-d '{
"event_type": "trigger-build",
"client_payload": {
"owner_name": "${{ github.repository_owner }}",
"repo_name": "${{ github.event.repository.name }}",
"branch": "${{ github.ref_name }}"
}
}'