forked from baron/baron-sso
locale_store 리팩토링
This commit is contained in:
@@ -8,9 +8,26 @@ on:
|
||||
branches:
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
run_lint:
|
||||
description: "Run linters for Go and Flutter"
|
||||
required: true
|
||||
type: boolean
|
||||
default: true
|
||||
run_backend_tests:
|
||||
description: "Run backend Go tests"
|
||||
required: true
|
||||
type: boolean
|
||||
default: true
|
||||
run_userfront_tests:
|
||||
description: "Run userfront Flutter tests"
|
||||
required: true
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
if: ${{ github.event_name != 'workflow_dispatch' || inputs.run_lint == true }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -54,7 +71,7 @@ jobs:
|
||||
|
||||
backend-tests:
|
||||
needs: lint
|
||||
if: ${{ always() }}
|
||||
if: ${{ always() && (github.event_name != 'workflow_dispatch' || inputs.run_backend_tests == true) }}
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
redis:
|
||||
@@ -88,7 +105,7 @@ jobs:
|
||||
|
||||
userfront-tests:
|
||||
needs: lint
|
||||
if: ${{ always() }}
|
||||
if: ${{ always() && (github.event_name != 'workflow_dispatch' || inputs.run_userfront_tests == true) }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -100,12 +117,34 @@ jobs:
|
||||
channel: "stable"
|
||||
cache: true
|
||||
|
||||
- name: Ensure browser for Flutter web tests
|
||||
run: |
|
||||
if command -v google-chrome >/dev/null 2>&1 || command -v google-chrome-stable >/dev/null 2>&1 || command -v chromium-browser >/dev/null 2>&1 || command -v chromium >/dev/null 2>&1; then
|
||||
echo "Chrome/Chromium already installed."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if command -v sudo >/dev/null 2>&1; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y chromium-browser || sudo apt-get install -y chromium
|
||||
else
|
||||
apt-get update
|
||||
apt-get install -y chromium-browser || apt-get install -y chromium
|
||||
fi
|
||||
|
||||
- name: Run userfront tests
|
||||
run: |
|
||||
cd userfront
|
||||
if [ -d test ]; then
|
||||
CHROME_BIN="$(command -v google-chrome || command -v google-chrome-stable || command -v chromium-browser || command -v chromium || true)"
|
||||
if [ -z "$CHROME_BIN" ]; then
|
||||
echo "Chrome/Chromium not found for web tests."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export CHROME_EXECUTABLE="$CHROME_BIN"
|
||||
flutter test
|
||||
# flutter test --platform chrome test/locale_storage_platform_test.dart
|
||||
flutter test --platform chrome test/locale_storage_platform_test.dart
|
||||
else
|
||||
echo "No userfront tests: skipping (test/ directory not found)."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user