Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/ardent-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test with Ardent branch

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
test:
runs-on: ubuntu-latest
Comment thread
greptile-apps[bot] marked this conversation as resolved.
timeout-minutes: 15
env:
ARDENT_BRANCH: pr-${{ github.event.pull_request.number }}-${{ github.run_id }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "22"

- name: Install dependencies
run: npm ci

- name: Install Ardent CLI
run: npm install -g ardent-cli@0.0.46

- name: Log in to Ardent
env:
ARDENT_TOKEN: ${{ secrets.ARDENT_TOKEN }}
run: ardent login --token "$ARDENT_TOKEN"

- name: Select project and connector
env:
ARDENT_TOKEN: ${{ secrets.ARDENT_TOKEN }}
run: |
# Internal docs validation fixture; see workflows/ci-cd.mdx for the generic workflow.
ardent project switch newer-testing
ardent connector switch new-connector
Comment thread
greptile-apps[bot] marked this conversation as resolved.

- name: Create database branch
env:
ARDENT_TOKEN: ${{ secrets.ARDENT_TOKEN }}
run: |
DATABASE_URL="$(ardent branch create "$ARDENT_BRANCH" --print-url)"
echo "ARDENT_BRANCH_CREATED=true" >> "$GITHUB_ENV"
case "$DATABASE_URL" in
postgres://*|postgresql://*) ;;
*) echo "Ardent did not return a Postgres database URL" >&2; exit 1 ;;
esac
echo "::add-mask::$DATABASE_URL"
echo "DATABASE_URL=$DATABASE_URL" >> "$GITHUB_ENV"
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Comment thread
greptile-apps[bot] marked this conversation as resolved.

- name: Run migration tests
run: npm test

- name: Delete database branch
if: always() && env.ARDENT_BRANCH_CREATED == 'true'
env:
ARDENT_TOKEN: ${{ secrets.ARDENT_TOKEN }}
run: ardent branch delete "$ARDENT_BRANCH"
Loading
Loading