diff --git a/.gitea/workflows/commit.yaml b/.gitea/workflows/commit.yaml index e2e3dc3..9d83b19 100644 --- a/.gitea/workflows/commit.yaml +++ b/.gitea/workflows/commit.yaml @@ -3,9 +3,11 @@ run-name: ${{ gitea.event.head_commit.message }} on: push: branches: + - dev - master jobs: test: + if: gitea.ref_name == 'dev' runs-on: debian-latest steps: - name: Checkout @@ -18,8 +20,8 @@ jobs: run: bats tests/shell/git_update.bats deploy: + if: gitea.ref_name == 'master' runs-on: self-hosted - needs: test steps: - name: Custom Checkout env: @@ -43,6 +45,7 @@ jobs: rm .vault_pass.txt promote_stable: + if: gitea.ref_name == 'master' runs-on: self-hosted needs: deploy steps: diff --git a/resources/js/pages/Acp.jsx b/resources/js/pages/Acp.jsx index 152e431..1e8a8ab 100644 --- a/resources/js/pages/Acp.jsx +++ b/resources/js/pages/Acp.jsx @@ -63,7 +63,6 @@ const StatusIcon = ({ status = 'bad', tooltip }) => { } function Acp({ isAdmin }) { - const forcedMinPhpForTesting = '>=8.5' const { t } = useTranslation() const { roles: authRoles } = useAuth() const canManageFounder = authRoles.includes('ROLE_FOUNDER') @@ -470,11 +469,21 @@ function Acp({ isAdmin }) { } const cliDefaultPhpIsSufficient = useMemo(() => { + const minimum = parseMinPhpConstraint(systemStatus?.min_versions?.php) const current = normalizeSemver(systemStatus?.php_default_version) - const minimum = parseMinPhpConstraint(forcedMinPhpForTesting || systemStatus?.min_versions?.php) - if (!current || !minimum) return false + if (!minimum) return true + if (!current) return false return compareSemver(current, minimum) >= 0 - }, [systemStatus, forcedMinPhpForTesting]) + }, [systemStatus]) + + const phpSelectedIsSufficient = useMemo(() => { + if (!systemStatus?.php_selected_ok) return false + const minimum = parseMinPhpConstraint(systemStatus?.min_versions?.php) + const current = normalizeSemver(systemStatus?.php_selected_version) + if (!minimum) return true + if (!current) return false + return compareSemver(current, minimum) >= 0 + }, [systemStatus]) const systemChecks = useMemo(() => { if (!systemStatus) return [] @@ -483,9 +492,9 @@ function Acp({ isAdmin }) { id: 'php', label: 'PHP', path: systemStatus.php_selected_path || '—', - min: forcedMinPhpForTesting || systemStatus.min_versions?.php || '—', + min: systemStatus.min_versions?.php || '—', current: systemStatus.php_selected_version || '—', - status: systemStatus.php_selected_ok ? 'ok' : 'bad', + status: phpSelectedIsSufficient ? 'ok' : 'bad', }, { id: 'composer', @@ -563,7 +572,7 @@ function Acp({ isAdmin }) { status: systemStatus.updates_writable ? 'ok' : 'bad', }, ] - }, [systemStatus, t]) + }, [phpSelectedIsSufficient, systemStatus, t]) const visibleSystemChecks = useMemo(() => { const visibilityBySection = { @@ -3906,7 +3915,7 @@ function Acp({ isAdmin }) { )}