Add bdd on github

This commit is contained in:
Fang-Pen Lin
2025-11-07 17:24:29 -08:00
parent c4b759b6a8
commit b5a88a83a5
2 changed files with 61 additions and 0 deletions

4
.github/resources/.env.bdd vendored Normal file
View File

@@ -0,0 +1,4 @@
ACME_DEVELOPMENT_MODE=true
ACME_FEATURE_ENABLED=true
# TODO: fix the wrong override
ACME_DEVELOPMENT_HTTP01_CHALLENGE_HOST_OVERRIDES='{"localhost": "192.168.50.215:8087"}'

View File

@@ -0,0 +1,57 @@
name: "Run backend BDD tests"
on:
pull_request:
types: [opened, synchronize]
paths:
- "backend/**"
- "!backend/README.md"
- "!backend/.*"
- "backend/.eslintrc.js"
workflow_call:
jobs:
check-be-pr:
name: Run BDD tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker system prune -af
- name: ☁️ Checkout source
uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install Python
run: uv python install
- uses: KengoTODA/actions-setup-docker-compose@v1
if: ${{ env.ACT }}
name: Install `docker compose` for local simulations
with:
version: "2.14.2"
- name: 🔧 Setup Node 20
uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm install
working-directory: backend
- name: Start Infisical
run: cp .github/resources/.env.bdd .env && docker compose -f docker-compose.dev.yml up
- name: Run bdd tests
run: npm run test:bdd
working-directory: backend
env:
INFISICAL_API_URL: http://localhost:8080
BOOTSTRAP_INFISICAL: "1"
- name: cleanup
run: |
docker compose -f "docker-compose.dev.yml" down