Skip to content

Commit 39d9e53

Browse files
authored
Update GH actions run vars (#3013)
1 parent 108c0ba commit 39d9e53

File tree

6 files changed

+31
-10
lines changed

6 files changed

+31
-10
lines changed

.github/actions/flutter-test/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,18 @@ runs:
3636
if: matrix.target == 'linux' || matrix.target == 'windows' || matrix.target == 'macos'
3737
working-directory: ${{ inputs.directory }}
3838
shell: bash
39+
env:
40+
INPUT_DIRECTORY: ${{ inputs.directory }}
3941
run: |
40-
testCmd="flutter test ${{ (inputs.directory == 'isar' && '-j 1') || '' }} --test-randomize-ordering-seed=random"
42+
if [[ "$INPUT_DIRECTORY" == 'isar' ]]; then
43+
testCmd="flutter test -j 1 --test-randomize-ordering-seed=random"
44+
else
45+
testCmd="flutter test --test-randomize-ordering-seed=random"
46+
fi
47+
4148
if ${{ (matrix.target == 'linux' && matrix.sdk == 'stable' && 'true') || 'false' }} ; then
4249
$testCmd --coverage
43-
if [[ '${{ inputs.directory }}' == 'flutter' ]] ; then
50+
if [[ "$INPUT_DIRECTORY" == 'flutter' ]] ; then
4451
dart run remove_from_coverage -f coverage/lcov.info -r 'binding.dart'
4552
fi
4653
else

.github/workflows/analyze.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ jobs:
3737
- uses: subosito/flutter-action@395322a6cded4e9ed503aebd4cc1965625f8e59a # [email protected]
3838
if: ${{ inputs.sdk == 'flutter' }}
3939

40-
- run: ${{ inputs.sdk }} pub get
41-
- run: ${{ inputs.sdk }} pub get
40+
- run: dart pub get
41+
if: ${{ inputs.sdk == 'dart' }}
42+
43+
- run: flutter pub get
44+
if: ${{ inputs.sdk == 'flutter' }}
45+
46+
- run: flutter pub get
4247
if: ${{ inputs.package == 'flutter' }}
4348
working-directory: flutter/microbenchmarks
49+
4450
- run: dart format --set-exit-if-changed ./
4551

4652
- name: dart analyze
@@ -77,10 +83,11 @@ jobs:
7783
env:
7884
TOTAL: ${{ steps.analysis.outputs.total }}
7985
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
86+
PANA_THRESHOLD: ${{ inputs.panaThreshold }}
8087
run: |
8188
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
82-
if (( $PERCENTAGE < ${{ inputs.panaThreshold }} ))
89+
if (( $PERCENTAGE < $PANA_THRESHOLD ))
8390
then
84-
echo "Score too low ($PERCENTAGE % is less than the expected ${{ inputs.panaThreshold }} %)!"
91+
echo "Score too low ($PERCENTAGE % is less than the expected $PANA_THRESHOLD %)!"
8592
exit 1
8693
fi

.github/workflows/diagrams.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,6 @@ jobs:
6969
# we need to pass the current branch, otherwise we can't commit the changes.
7070
# GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
7171
- name: Commit & push
72-
run: ./scripts/commit-code.sh ${{ steps.extract_branch.outputs.branch }} "Update class diagrams"
72+
run: ./scripts/commit-code.sh "$BRANCH_NAME" "Update class diagrams"
73+
env:
74+
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}

.github/workflows/flutter-symbols.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ jobs:
4545
env:
4646
GITHUB_TOKEN: ${{ github.token }}
4747

48-
- run: dart run bin/flutter_symbol_collector.dart --version=${{ inputs.flutter_version || '3.*.*' }}
48+
- run: dart run bin/flutter_symbol_collector.dart --version="$FLUTTER_VERSION"
4949
timeout-minutes: 300
5050
env:
5151
GITHUB_TOKEN: ${{ github.token }}
52+
FLUTTER_VERSION: ${{ inputs.flutter_version || '3.*.*' }}
5253

5354
- name: Upload updated status cache of processed files
5455
uses: actions/upload-artifact@v4

.github/workflows/flutter_test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ jobs:
157157
# Should be OK because it will likely be removed after switching to FFI (see https://github.com/getsentry/sentry-dart/issues/1444).
158158
if: ${{ matrix.target != 'macos' }}
159159
working-directory: ./flutter/example/${{ matrix.target }}
160-
run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=${{ steps.device.outputs.platform }}" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO
160+
run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=$DEVICE_PLATFORM" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO
161+
env:
162+
DEVICE_PLATFORM: ${{ steps.device.outputs.platform }}
161163

162164
test-web:
163165
runs-on: ubuntu-latest

.github/workflows/format-and-fix.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@ jobs:
5151
# we need to pass the current branch, otherwise we can't commit the changes.
5252
# GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
5353
- name: Commit & push
54-
run: ./scripts/commit-code.sh ${{ steps.extract_branch.outputs.branch }} "Format & fix code"
54+
run: ./scripts/commit-code.sh "$BRANCH_NAME" "Format & fix code"
55+
env:
56+
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}

0 commit comments

Comments
 (0)