diff --git a/.github/workflows/celest_core.yaml b/.github/workflows/celest_core.yaml index f03c044e..46e52487 100644 --- a/.github/workflows/celest_core.yaml +++ b/.github/workflows/celest_core.yaml @@ -105,8 +105,9 @@ jobs: uses: subosito/flutter-action@62f096cacda5168a3bd7b95793373be14fa4fbaf # 2.13.0 with: cache: true - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev + - name: Setup Test Environment + working-directory: packages/celest_core + run: tool/setup-ci.sh - name: Get Packages working-directory: packages/celest_core run: dart pub get diff --git a/packages/celest_core/tool/setup-ci.sh b/packages/celest_core/tool/setup-ci.sh new file mode 100755 index 00000000..f986e842 --- /dev/null +++ b/packages/celest_core/tool/setup-ci.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +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 && -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