From 73eea44b5142c28679fd60332901f48bf9aea433 Mon Sep 17 00:00:00 2001 From: Nadeshiko Manju Date: Mon, 23 Oct 2023 13:21:59 +0800 Subject: [PATCH] refactor(service/postgresql): Migrate task to new task planner (#3358) * refactor(service/postgresql): Migrate task to new task planner Signed-off-by: Manjusaka * Update code Signed-off-by: Manjusaka * update code Signed-off-by: Manjusaka --------- Signed-off-by: Manjusaka --- .../services/postgresql/postgresql/action.yml | 36 ++++++++++ .github/workflows/service_test_postgresql.yml | 65 ------------------- 2 files changed, 36 insertions(+), 65 deletions(-) create mode 100644 .github/services/postgresql/postgresql/action.yml delete mode 100644 .github/workflows/service_test_postgresql.yml diff --git a/.github/services/postgresql/postgresql/action.yml b/.github/services/postgresql/postgresql/action.yml new file mode 100644 index 000000000000..6b3ddabe028b --- /dev/null +++ b/.github/services/postgresql/postgresql/action.yml @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: postgresql +description: 'Behavior test for postgresql' + +runs: + using: "composite" + steps: + - name: Setup PostgreSQL Server + shell: bash + working-directory: fixtures/postgresql + run: docker-compose -f docker-compose.yml up -d + - name: Setup + shell: bash + run: | + cat << EOF >> $GITHUB_ENV + OPENDAL_POSTGRESQL_CONNECTION_STRING=postgresql://user:password@localhost:5432/testdb + OPENDAL_POSTGRESQL_TABLE=data + OPENDAL_POSTGRESQL_KEY_FIELD=key + OPENDAL_POSTGRESQL_VALUE_FIELD=value + EOF diff --git a/.github/workflows/service_test_postgresql.yml b/.github/workflows/service_test_postgresql.yml deleted file mode 100644 index 6fdaa0b025eb..000000000000 --- a/.github/workflows/service_test_postgresql.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -name: Service Test Postgresql - -on: - push: - branches: - - main - pull_request: - branches: - - main - paths: - - "core/src/**" - - "core/tests/**" - - "!core/src/docs/**" - - "!core/src/services/**" - - "core/src/services/postgresql/**" - - ".github/workflows/service_test_postgresql.yml" - - "fixtures/postgresql/**" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} - cancel-in-progress: true - -jobs: - postgresql: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Setup Postgresql Server - shell: bash - working-directory: fixtures/postgresql - run: docker-compose -f docker-compose.yml up -d - - - name: Setup Rust toolchain - uses: ./.github/actions/setup - with: - need-nextest: true - - - name: Test - shell: bash - working-directory: core - run: cargo nextest run behavior --features services-postgresql - env: - OPENDAL_TEST: postgresql - OPENDAL_POSTGRESQL_CONNECTION_STRING: postgresql://user:password@localhost:5432/testdb - OPENDAL_POSTGRESQL_TABLE: data - OPENDAL_POSTGRESQL_KEY_FIELD: key - OPENDAL_POSTGRESQL_VALUE_FIELD: value