mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 09:52:54 +00:00
114 lines
4.5 KiB
YAML
114 lines
4.5 KiB
YAML
name: Cloud Extensions Test
|
|
on:
|
|
schedule:
|
|
# * is a special character in YAML so you have to quote this string
|
|
# ┌───────────── minute (0 - 59)
|
|
# │ ┌───────────── hour (0 - 23)
|
|
# │ │ ┌───────────── day of the month (1 - 31)
|
|
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
|
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
|
- cron: '45 1 * * *' # run once a day, timezone is utc
|
|
workflow_dispatch: # adds ability to run this manually
|
|
inputs:
|
|
project_id:
|
|
description: 'Project region id. If not set, the default region will be used'
|
|
required: false
|
|
default: 'raspy-voice-43157743'
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash -euxo pipefail {0}
|
|
|
|
permissions:
|
|
id-token: write # aws-actions/configure-aws-credentials
|
|
statuses: write
|
|
contents: write
|
|
|
|
jobs:
|
|
regress:
|
|
env:
|
|
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
|
|
TEST_OUTPUT: /tmp/test_output
|
|
BUILD_TYPE: remote
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
pg-version: [17]
|
|
|
|
runs-on: us-east-2
|
|
container:
|
|
# We use the neon-test-extensions image here as it contains the source code for the extensions.
|
|
image: ghcr.io/neondatabase/neon-test-extensions-v${{ matrix.pg-version }}:14928114423
|
|
credentials:
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
options: --init
|
|
|
|
steps:
|
|
- name: Harden the runner (Audit all outbound calls)
|
|
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Evaluate the settings
|
|
id: project-settings
|
|
run: |
|
|
if [[ $((${{ matrix.pg-version }})) -lt 17 ]]; then
|
|
ULID=ulid
|
|
else
|
|
ULID=pgx_ulid
|
|
fi
|
|
LIBS=timescaledb:rag_bge_small_en_v15,rag_jina_reranker_v1_tiny_en:$ULID
|
|
settings=$(jq -c -n --arg libs $LIBS '{preload_libraries:{use_defaults:false,enabled_libraries:($libs| split(":"))}, compute_flags:{target_architecture:"x64"}}')
|
|
echo settings=$settings >> $GITHUB_OUTPUT
|
|
|
|
- name: Get the connection URI
|
|
id: connect-uri
|
|
run: |
|
|
res=$(curl -w "%{http_code}" -X GET \
|
|
"https://console-stage.neon.build/api/v2/projects/${PROJECT_ID}/connection_uri?database_name=neondb&role_name=neondb_owner&pooled=false" \
|
|
-H 'accept: application/json' \
|
|
-H "Authorization: Bearer ${API_KEY}"
|
|
)
|
|
code=${res: -3}
|
|
echo ${code}
|
|
if [[ ${code} -ge 400 ]]; then
|
|
echo ${res::-3}
|
|
exit 1
|
|
fi
|
|
URI=$(echo ${res::-3} | jq -r .uri)
|
|
sed +x
|
|
password=$(echo "$URI" | sed -n 's|.*://[^:]*:\([^@]*\)@.*|\1|p')
|
|
echo ::add-mask::$password
|
|
echo uri=${URI} >> ${GITHUB_OUTPUT}
|
|
env:
|
|
PROJECT_ID: ${{ inputs.project_id }}
|
|
API_KEY: ${{ secrets.NEON_STAGING_API_KEY }}
|
|
|
|
- name: Run the regression tests
|
|
run: /run-tests.sh -r /ext-src
|
|
env:
|
|
BENCHMARK_CONNSTR: ${{ steps.connect-uri.outputs.uri }}
|
|
SKIP: "hll-src,hypopg-src,ip4r-src,pg_cron-src,pg_graphql-src,pg_hint_plan-src,pg_ivm-src,pg_jsonschema-src,pg_repack-src,pg_roaringbitmap-src,pg_semver-src,pg_session_jwt-src,pg_tiktoken-src,pg_uuidv7-src,pgjwt-src,pgrag-src,pgtap-src,pgvector-src,pgx_ulid-src,plv8-src,postgresql-unit-src,prefix-src,rag_bge_small_en_v15-src,rag_jina_reranker_v1_tiny_en-src,rum-src,plpgsql_check-src"
|
|
|
|
- name: Delete Neon Project
|
|
if: ${{ always() }}
|
|
uses: ./.github/actions/neon-project-delete
|
|
with:
|
|
project_id: ${{ steps.create-neon-project.outputs.project_id }}
|
|
api_key: ${{ secrets.NEON_STAGING_API_KEY }}
|
|
|
|
- name: Post to a Slack channel
|
|
if: ${{ github.event.schedule && failure() }}
|
|
uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
|
|
with:
|
|
channel-id: ${{ vars.SLACK_ON_CALL_QA_STAGING_STREAM }}
|
|
slack-message: |
|
|
Periodic extensions test on staging: ${{ job.status }}
|
|
<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
|
|
env:
|
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
|