Skip to content

Commit 67e4bd9

Browse files
committed
Revert "refactor: update build.yml to add integration testing and clean up authentication steps"
This reverts commit 6f3d37d.
1 parent 6ce4a31 commit 67e4bd9

File tree

1 file changed

+13
-68
lines changed

1 file changed

+13
-68
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ jobs:
6464
test:
6565
name: Test (Dart ${{ matrix.dart-version }})
6666
runs-on: ubuntu-latest
67+
permissions:
68+
contents: 'read'
69+
id-token: 'write'
6770

6871
strategy:
6972
fail-fast: false
@@ -90,6 +93,12 @@ jobs:
9093
with:
9194
channel: ${{ matrix.dart-version }}
9295

96+
- name: Authenticate to Google Cloud/Firebase
97+
uses: google-github-actions/auth@v2
98+
with:
99+
workload_identity_provider: '${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}'
100+
service_account: '${{ secrets.SERVICE_ACCOUNT }}'
101+
93102
- name: Cache pub dependencies
94103
uses: actions/cache@v3
95104
with:
@@ -134,13 +143,13 @@ jobs:
134143
# Save individual package coverage files before merging
135144
cp coverage.lcov coverage_admin.lcov
136145
cp ../google_cloud_firestore/coverage.lcov coverage_firestore.lcov
137-
146+
138147
# Merge coverage reports from all packages (relative to packages/dart_firebase_admin)
139148
# Only merge files that exist
140149
COVERAGE_FILES=""
141150
[ -f coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES coverage.lcov"
142151
[ -f ../google_cloud_firestore/coverage.lcov ] && COVERAGE_FILES="$COVERAGE_FILES ../google_cloud_firestore/coverage.lcov"
143-
152+
144153
if [ -n "$COVERAGE_FILES" ]; then
145154
cat $COVERAGE_FILES > merged_coverage.lcov
146155
mv merged_coverage.lcov coverage.lcov
@@ -201,7 +210,7 @@ jobs:
201210
echo "coverage=${COVERAGE_PCT}" >> $GITHUB_OUTPUT
202211
echo "total_lines=${TOTAL_LINES}" >> $GITHUB_OUTPUT
203212
echo "hit_lines=${HIT_LINES}" >> $GITHUB_OUTPUT
204-
213+
205214
echo "admin_coverage=${ADMIN_PCT}" >> $GITHUB_OUTPUT
206215
echo "firestore_coverage=${FIRESTORE_PCT}" >> $GITHUB_OUTPUT
207216
echo "storage_coverage=${STORAGE_PCT}" >> $GITHUB_OUTPUT
@@ -288,74 +297,10 @@ jobs:
288297
flags: unittests
289298
fail_ci_if_error: false
290299

291-
test-integration:
292-
name: Test - Integration (Dart ${{ matrix.dart-version }})
293-
runs-on: ubuntu-latest
294-
# Skip for fork PRs — secrets are not available
295-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
296-
permissions:
297-
contents: 'read'
298-
id-token: 'write'
299-
300-
strategy:
301-
fail-fast: false
302-
matrix:
303-
dart-version: [stable, beta]
304-
305-
defaults:
306-
run:
307-
working-directory: packages/dart_firebase_admin
308-
309-
steps:
310-
- uses: actions/checkout@v4
311-
with:
312-
fetch-depth: 2
313-
314-
- uses: subosito/flutter-action@v2.7.1
315-
with:
316-
channel: ${{ matrix.dart-version }}
317-
318-
- name: Authenticate to Google Cloud/Firebase
319-
uses: google-github-actions/auth@v2
320-
with:
321-
workload_identity_provider: '${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}'
322-
service_account: '${{ secrets.SERVICE_ACCOUNT }}'
323-
324-
- name: Cache pub dependencies
325-
uses: actions/cache@v3
326-
with:
327-
path: ~/.pub-cache
328-
key: pub-${{ matrix.dart-version }}-${{ hashFiles('**/pubspec.lock') }}
329-
restore-keys: |
330-
pub-${{ matrix.dart-version }}-
331-
pub-
332-
333-
- name: Add pub cache bin to PATH
334-
run: |
335-
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
336-
echo "PUB_CACHE=$HOME/.pub-cache" >> $GITHUB_ENV
337-
338-
- name: Install Melos
339-
run: dart pub global activate melos
340-
working-directory: .
341-
342-
- name: Bootstrap workspace
343-
run: melos bootstrap
344-
working-directory: .
345-
346-
- name: Run integration tests
347-
run: dart test test/app/firebase_app_prod_test.dart --concurrency=1
348-
349300
build:
350301
name: Build verification (Dart ${{ matrix.dart-version }})
351302
runs-on: ubuntu-latest
352-
needs: [lint, test, test-integration]
353-
# Run even if test-integration was skipped (fork PRs), but not if lint or test failed
354-
if: |
355-
always() &&
356-
needs.lint.result == 'success' &&
357-
needs.test.result == 'success' &&
358-
(needs.test-integration.result == 'success' || needs.test-integration.result == 'skipped')
303+
needs: [lint, test]
359304

360305
strategy:
361306
fail-fast: false

0 commit comments

Comments
 (0)