Repository navigation
85 lines (73 loc) · 2.43 KB
/
Copy pathci.yml
File metadata and controls
85 lines (73 loc) · 2.43 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }}
FLUTTER_SUPPRESS_ANALYTICS: "true"
FLUTTER_VERSION: "3.38.0"
jobs:
test:
name: Test - ${{ matrix.package }}
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && 'ubuntu-latest' || 'ubuntu-latest-large' }}
strategy:
fail-fast: false
matrix:
package:
- core
- plugins/plugin_adjust
- plugins/plugin_advertising_id
- plugins/plugin_amplitude
- plugins/plugin_appsflyer
- plugins/plugin_firebase
- plugins/plugin_idfa
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Flutter
uses: ./.github/actions/setup-flutter
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
sha256: c9cc746283f02dbad5da2785b4837b62f7956e3135fa9af87c7dde2d2bd6c5a6
- name: Authenticate with Artifactory
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/artifactory-oidc
- name: Get dependencies
run: flutter pub get
working-directory: packages/${{ matrix.package }}
- name: Analyze
run: flutter analyze
working-directory: packages/${{ matrix.package }}
# Only core ships tests; the plugin packages have no test/ directory and
# `flutter test` treats that as an error rather than a no-op.
- name: Run tests
run: |
if [ -d test ]; then
flutter test --coverage
else
echo "No test/ directory in ${{ matrix.package }} — nothing to run."
fi
working-directory: packages/${{ matrix.package }}
all-checks:
name: All Checks Passed
needs: [test]
# Bare ubuntu-latest gets no runner in this org, so this job queued forever
# and the whole workflow never concluded.
runs-on: ubuntu-latest-large
if: always()
steps:
- name: Check all job statuses
run: |
if [ "${{ needs.test.result }}" != "success" ]; then
echo "One or more checks failed"
exit 1
fi