Skip to content

[Admin Governance] Rebuild orphaned editor groups during repair #84957

[Admin Governance] Rebuild orphaned editor groups during repair

[Admin Governance] Rebuild orphaned editor groups during repair #84957

name: Lint & Build & Test (core)
on:
push:
workflow_dispatch:
permissions:
contents: read
pull-requests: write
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
core-changed: ${{ steps.changes.outputs.core }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for relevant changes
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: changes
with:
base: ${{ github.event.repository.default_branch }}
filters: |
core:
- 'core/**'
- '.github/workflows/build-and-test-core.yml'
- name: Workflow Decision Summary
env:
CORE_CHANGES: ${{ steps.changes.outputs.core }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
run: |
if [ "${CORE_CHANGES}" == "true" ]; then
echo "🔍 Workflow Decision: RUNNING TESTS"
echo "✅ Core changes detected vs ${DEFAULT_BRANCH} - running tests"
else
echo "🔍 Workflow Decision: SKIPPING TESTS"
echo "⏭️ No core changes vs ${DEFAULT_BRANCH} - skipping tests"
fi
test:
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.core-changed == 'true'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install minimal stable
uses: dtolnay/rust-toolchain@aad518f59d88bae90133242f9ddac7f8bbc5dddf # 1.94.1
with:
components: rustfmt
- name: Install Redis
uses: chenjuneking/redis-setup-action@36d2a503dcaa6984bb9331708770438c4d323f88 # v1
with:
version: "7.2.5"
hostPort: 5434
containerPort: 6379
- name: Install Postgres
uses: dust-tt/postgresql-action@91c1ba371e7f9529945c312bb2883e9e0630063b
with:
postgresql docker image: mirror.gcr.io/postgres
postgresql version: "14.13"
postgresql db: oauth
postgresql user: test
postgresql password: test
postgresql port: 5433
- name: Install Protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: core
- name: Lint
working-directory: core
run: cargo fmt --all -- --check
- name: Setup Tables
working-directory: core
run: cargo run --bin init_db
env:
OAUTH_DATABASE_URI: "postgres://test:test@localhost:5433/oauth"
- name: Test
working-directory: core
run: cargo test --all
env:
DISABLE_API_KEY_CHECK: "true"
OAUTH_DATABASE_URI: "postgres://test:test@localhost:5433/oauth"
REDIS_URI: "redis://localhost:5434"
OAUTH_ENCRYPTION_KEY: ${{ secrets.TEST_OAUTH_ENCRYPTION_KEY }}
OAUTH_SLACK_CLIENT_ID: "test_slack_client_id"
OAUTH_SLACK_CLIENT_SECRET: "test_slack_client_secret"