diff --git a/.github/services/azblob/azure_azblob/action.yml b/.github/services/azblob/azure_azblob/action.yml new file mode 100644 index 000000000000..339e6f87b996 --- /dev/null +++ b/.github/services/azblob/azure_azblob/action.yml @@ -0,0 +1,32 @@ +# 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: azure_azblob +description: 'Behavior test for Azure azblob. This service is sponsored by @datafuse_labs.' + +runs: + using: "composite" + steps: + - name: Setup + uses: 1password/load-secrets-action@v1 + with: + export-env: true + env: + OPENDAL_AZBLOB_CONTAINER: op://services/azblob/container + OPENDAL_AZBLOB_ENDPOINT: op://services/azblob/endpoint + OPENDAL_AZBLOB_ACCOUNT_NAME: op://services/azblob/account_name + OPENDAL_AZBLOB_ACCOUNT_KEY: op://services/azblob/account_key diff --git a/.github/services/azblob/azurite_azblob/action.yml b/.github/services/azblob/azurite_azblob/action.yml new file mode 100644 index 000000000000..ac1c1abed25f --- /dev/null +++ b/.github/services/azblob/azurite_azblob/action.yml @@ -0,0 +1,44 @@ +# 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: azurite_azblob +description: 'Behavior test for azurite azblob' + +runs: + using: "composite" + steps: + - name: Setup azurite azblob service + shell: bash + working-directory: fixtures/azblob + run: docker-compose -f docker-compose-azurite.yml up -d + - name: Setup test bucket + shell: bash + run: | + az storage container create \ + --name test \ + --connection-string "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;" + - name: Setup + shell: bash + run: | + cat << EOF >> $GITHUB_ENV + RUST_BACKTRACE=full + RUST_LOG=debug + OPENDAL_AZBLOB_CONTAINER=test + OPENDAL_AZBLOB_ENDPOINT=http://127.0.0.1:10000/devstoreaccount1 + OPENDAL_AZBLOB_ACCOUNT_NAME=devstoreaccount1 + OPENDAL_AZBLOB_ACCOUNT_KEY=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw== + EOF diff --git a/.github/services/sqlite/sqlite/action.yml b/.github/services/sqlite/sqlite/action.yml index e5d3e6c47777..1612e6246521 100644 --- a/.github/services/sqlite/sqlite/action.yml +++ b/.github/services/sqlite/sqlite/action.yml @@ -21,13 +21,13 @@ description: 'Behavior test for sqlite' runs: using: "composite" steps: - - name: Setup Sqlite + - name: Setup Sqlite shell: bash working-directory: fixtures/sqlite run: mkdir -p /tmp/opendal && sqlite3 /tmp/opendal/test.db < data.sql - - name: Setup - shell: bash - run: | + - name: Setup + shell: bash + run: | cat << EOF >> $GITHUB_ENV OPENDAL_SQLITE_CONNECTION_STRING=file:///tmp/opendal/test.db OPENDAL_SQLITE_TABLE=data diff --git a/.github/workflows/service_test_azblob.yml b/.github/workflows/service_test_azblob.yml deleted file mode 100644 index 102d36eb649b..000000000000 --- a/.github/workflows/service_test_azblob.yml +++ /dev/null @@ -1,103 +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 Azblob - -on: - push: - branches: - - main - pull_request: - branches: - - main - paths: - - "core/src/**" - - "core/tests/**" - - "!core/src/docs/**" - - "!core/src/services/**" - - "core/src/services/azblob/**" - - ".github/workflows/service_test_azblob.yml" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} - cancel-in-progress: true - -jobs: - azurite_azblob: - runs-on: ubuntu-latest - - # Setup azurite server - services: - azurite: - image: mcr.microsoft.com/azure-storage/azurite - ports: - - 10000:10000 - - steps: - - uses: actions/checkout@v4 - - name: Setup test bucket - run: | - az storage container create \ - --name test \ - --connection-string "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;" - - - name: Setup Rust toolchain - uses: ./.github/actions/setup - with: - need-nextest: true - - - name: Test - shell: bash - working-directory: core - run: cargo nextest run behavior - env: - RUST_BACKTRACE: full - RUST_LOG: debug - OPENDAL_TEST: azblob - OPENDAL_AZBLOB_CONTAINER: test - OPENDAL_AZBLOB_ENDPOINT: "http://127.0.0.1:10000/devstoreaccount1" - OPENDAL_AZBLOB_ACCOUNT_NAME: devstoreaccount1 - OPENDAL_AZBLOB_ACCOUNT_KEY: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw== - - azure_azblob: - runs-on: ubuntu-latest - if: (github.event_name == 'push' && github.repository == 'apache/incubator-opendal') || !github.event.pull_request.head.repo.fork - steps: - - uses: actions/checkout@v4 - - name: Setup Rust toolchain - uses: ./.github/actions/setup - with: - need-nextest: true - - - name: Load secret - id: op-load-secret - uses: 1password/load-secrets-action@v1 - with: - export-env: true - env: - OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} - OPENDAL_AZBLOB_CONTAINER: op://services/azblob/container - OPENDAL_AZBLOB_ENDPOINT: op://services/azblob/endpoint - OPENDAL_AZBLOB_ACCOUNT_NAME: op://services/azblob/account_name - OPENDAL_AZBLOB_ACCOUNT_KEY: op://services/azblob/account_key - - - name: Test - shell: bash - working-directory: core - run: cargo nextest run behavior - env: - OPENDAL_TEST: azblob diff --git a/fixtures/azblob/docker-compose-azurite.yml b/fixtures/azblob/docker-compose-azurite.yml new file mode 100644 index 000000000000..abbbc7e091dc --- /dev/null +++ b/fixtures/azblob/docker-compose-azurite.yml @@ -0,0 +1,24 @@ +# 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. + +version: '3.8' + +services: + redis: + image: mcr.microsoft.com/azure-storage/azurite + ports: + - 10000:10000