Barazo AppView backend barazo.forum

ci(api): composite setup action, lexicons cache, dependency graph (#128)

- Extract shared 5-step setup (checkout, pnpm, node, lexicons, install)
into .github/actions/setup composite action
- Cache lexicons build keyed on pnpm-lock.yaml hash, eliminating
redundant clones across 7 jobs
- Add dependency graph: lint+typecheck gate unit tests, unit tests gate
integration tests, schema-check needs lint. Build and security run
independently for fast signal.

authored by

Guido X Jansen and committed by
GitHub
495942a6 9715d4fc

+40 -70
+30
.github/actions/setup/action.yml
··· 1 + name: Setup Barazo API 2 + description: Install pnpm/Node.js, cache and build lexicons, install dependencies 3 + 4 + runs: 5 + using: composite 6 + steps: 7 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 8 + 9 + - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 10 + with: 11 + node-version: 24 12 + cache: 'pnpm' 13 + 14 + - name: Cache lexicons build 15 + id: lexicons-cache 16 + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 17 + with: 18 + path: ../barazo-lexicons 19 + key: lexicons-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} 20 + 21 + - name: Clone and build barazo-lexicons 22 + if: steps.lexicons-cache.outputs.cache-hit != 'true' 23 + shell: bash 24 + run: | 25 + git clone --depth 1 https://github.com/barazo-forum/barazo-lexicons.git ../barazo-lexicons 26 + cd ../barazo-lexicons && pnpm install --ignore-scripts && pnpm run build 27 + 28 + - name: Install dependencies 29 + shell: bash 30 + run: pnpm install --frozen-lockfile
+10 -70
.github/workflows/ci.yml
··· 20 20 timeout-minutes: 10 21 21 steps: 22 22 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 23 - - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 24 - - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 25 - with: 26 - node-version: 24 27 - cache: 'pnpm' 28 - - name: Clone and build barazo-lexicons 29 - run: | 30 - git clone --depth 1 https://github.com/barazo-forum/barazo-lexicons.git ../barazo-lexicons 31 - cd ../barazo-lexicons && pnpm install --ignore-scripts && pnpm run build 32 - - run: pnpm install --frozen-lockfile 23 + - uses: ./.github/actions/setup 33 24 - run: pnpm lint 34 25 35 26 typecheck: ··· 38 29 timeout-minutes: 10 39 30 steps: 40 31 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 41 - - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 42 - - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 43 - with: 44 - node-version: 24 45 - cache: 'pnpm' 46 - - name: Clone and build barazo-lexicons 47 - run: | 48 - git clone --depth 1 https://github.com/barazo-forum/barazo-lexicons.git ../barazo-lexicons 49 - cd ../barazo-lexicons && pnpm install --ignore-scripts && pnpm run build 50 - - run: pnpm install --frozen-lockfile 32 + - uses: ./.github/actions/setup 51 33 - run: pnpm typecheck 52 34 53 35 test: 54 36 name: Unit Tests 55 37 runs-on: ubuntu-latest 56 38 timeout-minutes: 15 39 + needs: [lint, typecheck] 57 40 steps: 58 41 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 59 - - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 60 - - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 61 - with: 62 - node-version: 24 63 - cache: 'pnpm' 64 - - name: Clone and build barazo-lexicons 65 - run: | 66 - git clone --depth 1 https://github.com/barazo-forum/barazo-lexicons.git ../barazo-lexicons 67 - cd ../barazo-lexicons && pnpm install --ignore-scripts && pnpm run build 68 - - run: pnpm install --frozen-lockfile 42 + - uses: ./.github/actions/setup 69 43 - run: pnpm test 70 44 71 45 test-integration: 72 46 name: Integration Tests 73 47 runs-on: ubuntu-latest 74 48 timeout-minutes: 30 49 + needs: [test] 75 50 services: 76 51 postgres: 77 52 image: pgvector/pgvector:pg16 ··· 97 72 --health-retries 3 98 73 steps: 99 74 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 100 - - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 101 - - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 102 - with: 103 - node-version: 24 104 - cache: 'pnpm' 105 - - name: Clone and build barazo-lexicons 106 - run: | 107 - git clone --depth 1 https://github.com/barazo-forum/barazo-lexicons.git ../barazo-lexicons 108 - cd ../barazo-lexicons && pnpm install --ignore-scripts && pnpm run build 109 - - run: pnpm install --frozen-lockfile 75 + - uses: ./.github/actions/setup 110 76 - run: pnpm db:migrate 111 77 env: 112 78 DATABASE_URL: postgresql://barazo:barazo_dev@localhost:5432/barazo ··· 123 89 timeout-minutes: 15 124 90 steps: 125 91 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 126 - - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 127 - - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 128 - with: 129 - node-version: 24 130 - cache: 'pnpm' 131 - - name: Clone and build barazo-lexicons 132 - run: | 133 - git clone --depth 1 https://github.com/barazo-forum/barazo-lexicons.git ../barazo-lexicons 134 - cd ../barazo-lexicons && pnpm install --ignore-scripts && pnpm run build 135 - - run: pnpm install --frozen-lockfile 92 + - uses: ./.github/actions/setup 136 93 - run: pnpm build 137 94 138 95 schema-check: 139 96 name: Schema Drift Check 140 97 runs-on: ubuntu-latest 141 98 timeout-minutes: 10 99 + needs: [lint] 142 100 steps: 143 101 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 144 - - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 145 - - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 146 - with: 147 - node-version: 24 148 - cache: 'pnpm' 149 - - name: Clone and build barazo-lexicons 150 - run: | 151 - git clone --depth 1 https://github.com/barazo-forum/barazo-lexicons.git ../barazo-lexicons 152 - cd ../barazo-lexicons && pnpm install --ignore-scripts && pnpm run build 153 - - run: pnpm install --frozen-lockfile 102 + - uses: ./.github/actions/setup 154 103 - name: Check for uncommitted schema changes 155 104 run: | 156 105 pnpm db:generate --name=ci-check ··· 168 117 timeout-minutes: 10 169 118 steps: 170 119 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 171 - - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 172 - - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 173 - with: 174 - node-version: 24 175 - cache: 'pnpm' 176 - - name: Clone and build barazo-lexicons 177 - run: | 178 - git clone --depth 1 https://github.com/barazo-forum/barazo-lexicons.git ../barazo-lexicons 179 - cd ../barazo-lexicons && pnpm install --ignore-scripts && pnpm run build 180 - - run: pnpm install --frozen-lockfile 120 + - uses: ./.github/actions/setup 181 121 - name: Security audit with retry 182 122 run: | 183 123 for attempt in 1 2 3; do