Skip to content

Commit

Permalink
ci: Add setup step
Browse files Browse the repository at this point in the history
Allows packages to declare a `setup.sh` script to run before running tests to allow for pluggable package-specific setup work.
  • Loading branch information
Dillon Nys committed Nov 16, 2022
1 parent fadb95a commit f7aab97
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/dart_dart2js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jobs:
timeout-minutes: 10
run: aft bootstrap

- name: Setup Package
if: "always() && steps.bootstrap.conclusion == 'success'"
shell: bash # Run in bash regardless of platform
run: |
if [ -e tool/setup.sh ]; then
./tool/setup.sh
fi
- name: Run Tests
if: "always() && steps.bootstrap.conclusion == 'success'"
run: dart run build_runner test --release --delete-conflicting-outputs -- -p ${{ matrix.browser }}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/dart_ddc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ jobs:
timeout-minutes: 10
run: aft bootstrap

- name: Setup Package
if: "always() && steps.bootstrap.conclusion == 'success'"
shell: bash # Run in bash regardless of platform
run: |
if [ -e tool/setup.sh ]; then
./tool/setup.sh
fi
- name: Run Tests
if: "always() && steps.bootstrap.conclusion == 'success' && (matrix.sdk == 'dev' || inputs.test-ddc-stable)"
run: dart run build_runner test --delete-conflicting-outputs -- -p ${{ matrix.browser }} --exclude-tags=no-ddc
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/dart_native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ jobs:
timeout-minutes: 15 # macOS needs extra time
run: aft bootstrap

- name: Setup Package
if: "always() && steps.bootstrap.conclusion == 'success'"
shell: bash # Run in bash regardless of platform
run: |
if [ -e tool/setup.sh ]; then
./tool/setup.sh
fi
- name: Run Tests
if: "always() && steps.bootstrap.conclusion == 'success'"
run: dart test --exclude-tags=build
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/dart_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ jobs:
echo "analysisDirs=lib" >> $GITHUB_OUTPUT
fi
- name: Setup Package
if: "always() && steps.bootstrap.conclusion == 'success'"
shell: bash # Run in bash regardless of platform
run: |
if [ -e tool/setup.sh ]; then
./tool/setup.sh
fi
- name: Analyze
if: "always() && steps.bootstrap.conclusion == 'success'"
run: dart analyze --fatal-infos --fatal-warnings ${{ steps.testCheck.outputs.analysisDirs }}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/flutter_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ jobs:
echo "analysisDirs=lib" >> $GITHUB_OUTPUT
fi
- name: Setup Package
if: "always() && steps.bootstrap.conclusion == 'success'"
shell: bash # Run in bash regardless of platform
run: |
if [ -e tool/setup.sh ]; then
./tool/setup.sh
fi
- name: Analyze
if: "always() && steps.bootstrap.conclusion == 'success'"
run: flutter analyze --fatal-infos --fatal-warnings ${{ steps.testCheck.outputs.analysisDirs }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt-get update && sudo apt-get install -y libsecret-1-dev gnome-keyring

# If running in headless mode, re-run script in dbus session.
if [ -z $DBUS_SESSION_BUS_ADDRESS ]; then
exec dbus-run-session -- $0
if [ -z $DBUS_SESSION_BUS_ADDRESS && -n $1 ]; then
exec dbus-run-session -- $@
fi

# Set up keyring in CI env
if [ -n $CI ]; then
echo 'password' | gnome-keyring-daemon --start --replace --daemonize --unlock
fi
fi

dart test

0 comments on commit f7aab97

Please sign in to comment.