diff --git a/.github/workflows/cloud-regress.yml b/.github/workflows/cloud-regress.yml index 7ae8d46000..0e2def217f 100644 --- a/.github/workflows/cloud-regress.yml +++ b/.github/workflows/cloud-regress.yml @@ -1,4 +1,4 @@ -name: Cloud Regression Test +name: Cloud Extensions Test on: schedule: # * is a special character in YAML so you have to quote this string @@ -9,6 +9,11 @@ on: # │ │ │ │ ┌───────────── 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: + region_id: + description: 'Project region id. If not set, the default region will be used' + required: false + default: 'aws-us-east-2' defaults: run: @@ -37,7 +42,7 @@ jobs: runs-on: us-east-2 container: - image: ghcr.io/neondatabase/build-tools:pinned-bookworm + image: ghcr.io/neondatabase/neon-test-extensions-v${{ matrix.pg-versions }}:latest credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -49,57 +54,16 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - submodules: true - - - name: Patch the test - env: - PG_VERSION: ${{matrix.pg-version}} - run: | - cd "vendor/postgres-v${PG_VERSION}" - patch -p1 < "../../compute/patches/cloud_regress_pg${PG_VERSION}.patch" - - - name: Generate a random password - id: pwgen - run: | - set +x - DBPASS=$(dd if=/dev/random bs=48 count=1 2>/dev/null | base64) - echo "::add-mask::${DBPASS//\//}" - echo DBPASS="${DBPASS//\//}" >> "${GITHUB_OUTPUT}" - - - name: Change tests according to the generated password - env: - DBPASS: ${{ steps.pwgen.outputs.DBPASS }} - PG_VERSION: ${{matrix.pg-version}} - run: | - cd vendor/postgres-v"${PG_VERSION}"/src/test/regress - for fname in sql/*.sql expected/*.out; do - sed -i.bak s/NEON_PASSWORD_PLACEHOLDER/"'${DBPASS}'"/ "${fname}" - done - for ph in $(grep NEON_MD5_PLACEHOLDER expected/password.out | awk '{print $3;}' | sort | uniq); do - USER=$(echo "${ph}" | cut -c 22-) - MD5=md5$(echo -n "${DBPASS}${USER}" | md5sum | awk '{print $1;}') - sed -i.bak "s/${ph}/${MD5}/" expected/password.out - done - - - name: Download Neon artifact - uses: ./.github/actions/download - with: - name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact - path: /tmp/neon/ - prefix: latest - aws-oicd-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }} - - - name: Create a new branch - id: create-branch - uses: ./.github/actions/neon-branch-create + - name: Create Neon Project + id: create-neon-project + uses: ./.github/actions/neon-project-create with: + region_id: ${{ inputs.region_id }} + postgres_version: ${{ matrix.pg-version }} api_key: ${{ secrets.NEON_STAGING_API_KEY }} - project_id: ${{ vars[format('PGREGRESS_PG{0}_PROJECT_ID', matrix.pg-version)] }} - name: Run the regression tests - uses: ./.github/actions/run-python-test-set + run: /run-tests.sh with: build_type: ${{ env.BUILD_TYPE }} test_selection: cloud_regress @@ -109,13 +73,12 @@ jobs: env: BENCHMARK_CONNSTR: ${{steps.create-branch.outputs.dsn}} - - name: Delete branch - if: always() - uses: ./.github/actions/neon-branch-delete + - 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 }} - project_id: ${{ vars[format('PGREGRESS_PG{0}_PROJECT_ID', matrix.pg-version)] }} - branch_id: ${{steps.create-branch.outputs.branch_id}} - name: Create Allure report id: create-allure-report