diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23f3431..700dc85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -147,3 +147,39 @@ jobs: TARGETARCH=amd64 PGVECTOR=0.8.0 tags: modelzai/vchord-cnpg:${{ matrix.version }}-v${{ env.SEMVER }} + + test: + name: Run tests + runs-on: + - ubuntu-latest + needs: ["semver", "build", "docker"] + strategy: + matrix: + version: [14, 15, 16] + platform: ["amd64"] + container: + image: modelzai/vchord-cnpg:${{ matrix.version }}-v${{ needs.semver.outputs.SEMVER }} + options: --user root + credentials: + username: ${{ secrets.DOCKERIO_MODELZ_USERNAME }} + password: ${{ secrets.DOCKERIO_MODELZ_TOKEN }} + env: + PGHOST: "localhost" + PGPORT: "5432" + PGDATABASE: "postgres" + PGUSER: "postgres" + PGPASSWORD: "postgres" + POSTGRES_PASSWORD: "password" + PGDATA: "/var/lib/postgresql/data2" + + steps: + - name: Install all extensions in registry + # Entrypoint is overwritten by GitHub Action. We need to execute it manually in order to start Postgres. + # More information here https://github.com/actions/runner/issues/1964 + run: | + bash /usr/local/bin/docker-entrypoint.sh postgres & + sleep 5 + curl https://registry.pgtrunk.io/extensions/all | jq -r ".[] | .name" > /tmp/extensions.txt + trunk-install.sh | tee /tmp/output.txt + cat /tmp/output.txt + diff --git a/.github/workflows/trunk-install-test.yml b/.github/workflows/trunk-install-test.yml deleted file mode 100644 index 5e1ee92..0000000 --- a/.github/workflows/trunk-install-test.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Trunk install test workflow - -on: - release: - types: [created] - workflow_dispatch: - inputs: - tag: - description: 'tag name (semver without v-prefix)' - required: true - type: string - -jobs: - semver: - runs-on: ubuntu-latest - outputs: - SEMVER: ${{ steps.semver.outputs.SEMVER }} - steps: - - uses: actions/github-script@v7 - id: semver - with: - script: | - const tag = "${{ github.event.inputs.tag }}" || "${{ github.event.release.tag_name }}"; - console.log(`Tag: ${tag}`); - const r = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; - if (!r.test(tag)) { - core.setFailed(`Action failed with an invalid semver.`); - } - core.setOutput('SEMVER', tag); - test: - name: Run tests - runs-on: - - ubuntu-latest - needs: ["semver"] - strategy: - matrix: - version: [14, 15, 16] - platform: ["amd64"] - container: - image: modelzai/vchord-cnpg:${{ matrix.version }}-v${{ needs.semver.outputs.SEMVER }} - options: --user root - credentials: - username: ${{ secrets.DOCKERIO_MODELZ_USERNAME }} - password: ${{ secrets.DOCKERIO_MODELZ_TOKEN }} - env: - PGHOST: "localhost" - PGPORT: "5432" - PGDATABASE: "postgres" - PGUSER: "postgres" - PGPASSWORD: "postgres" - POSTGRES_PASSWORD: "password" - PGDATA: "/var/lib/postgresql/data2" - - steps: - - name: Install all extensions in registry - # Entrypoint is overwritten by GitHub Action. We need to execute it manually in order to start Postgres. - # More information here https://github.com/actions/runner/issues/1964 - run: | - bash /usr/local/bin/docker-entrypoint.sh postgres & - sleep 5 - curl https://registry.pgtrunk.io/extensions/all | jq -r ".[] | .name" > /tmp/extensions.txt - trunk-install.sh | tee /tmp/output.txt - cat /tmp/output.txt