stack/.github/workflows/setup-tests.yaml
Bilal Godil dffe6277e5
Some checks failed
DB migration compat / Check if migrations changed (push) Has been cancelled
DB migration compat / Back-compat — Current branch migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migration compat / Forward-compat — Current branch code with ${{ needs.check-migrations-changed.outputs.base_branch }} branch migrations (push) Has been cancelled
DB migration compat / No migration changes (skipped) (push) Has been cancelled
Use canonical HEXCLAVE_* env vars across all GitHub Actions
Rename every STACK_*-prefixed env var to HEXCLAVE_* in the workflow files
(the legacy names still work via dual-read, but canonical is clearer and
avoids dual-read conflict checks firing on differing committed defaults).

- secrets.STACK_FREESTYLE_REAL_API_KEY is a repo secret, left unchanged; only
  the env-var key it's assigned to (HEXCLAVE_FREESTYLE_API_KEY) is renamed.
- HEXCLAVE_EMULATOR_HOME (qemu-emulator-build) is read directly via process.env
  in the CLI, not the dual-read helper, so emulator-paths.ts now reads
  HEXCLAVE_EMULATOR_HOME with a STACK_EMULATOR_HOME fallback.
- Also drop the explanatory comment added for the local-emulator flag.
2026-06-16 18:18:32 -07:00

59 lines
1.9 KiB
YAML

name: "Run setup tests"
on:
push:
branches:
- main
- dev
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
env:
SHELL: /usr/bin/bash
jobs:
setup-tests:
if: ${{ (github.head_ref || github.ref_name) == 'dev' }}
runs-on: ubicloud-standard-16
env:
HEXCLAVE_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
HEXCLAVE_EXTERNAL_DB_SYNC_DIRECT: "false"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup Node.js v22
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- name: Install packages
run: pnpm install
- run: pnpm run build:packages
- run: pnpm run codegen
- run: pnpm run start-deps
- uses: JarvusInnovations/background-action@2428e7b970a846423095c79d43f759abf979a635 # v1.0.7
with:
run: pnpm run dev &
wait-on: |
http://localhost:8102
tail: true
wait-for: 120s
log-output-if: true
- name: Run tests (first attempt)
id: run-tests-first-attempt
continue-on-error: ${{ (github.head_ref || github.ref_name) != 'main' && (github.head_ref || github.ref_name) != 'dev' }}
run: pnpm run test run --reporter=verbose
# These tests are often flakey, as a temporary measure we retry them once.
- name: Run tests (retry once on non-dev/main branches)
if: ${{ (github.head_ref || github.ref_name) != 'main' && (github.head_ref || github.ref_name) != 'dev' && steps.run-tests-first-attempt.outcome == 'failure' }}
run: pnpm run test run --reporter=verbose