| # |
| # 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: Integration Test for Operator Helm Charts |
| |
| on: push |
| |
| jobs: |
| run: |
| name: Integration Test for ShardingSphere Operator Helm Charts |
| runs-on: ubuntu-latest |
| steps: |
| - name: "checkout codes" |
| uses: actions/checkout@v3 |
| - name: "setup kind" |
| uses: helm/kind-action@v1.2.0 |
| - name: "setup helm" |
| uses: azure/setup-helm@v2.1 |
| - name: "setup kubectl" |
| uses: azure/setup-kubectl@v2.0 |
| - name: "Install Helm Charts for ShardingSphere Operator" |
| run: | |
| set -x |
| kubectl create namespace shardingsphere-operator |
| cd charts/shardingsphere-operator/ |
| helm dependency build |
| cd ../ |
| helm install shardingsphere-operator shardingsphere-operator -n shardingsphere-operator --set replicaCount=1 |
| kubectl wait --timeout=120s --for=condition=Ready --all pod -n shardingsphere-operator |
| kubectl get pod -n shardingsphere-operator --show-labels |
| - name: "Install Helm Charts for ShardingSphere Cluster" |
| run: | |
| set -x |
| kubectl create namespace shardingsphere |
| cd charts/shardingsphere-cluster |
| helm dependency build |
| cd ../ |
| helm install shardingsphere-cluster shardingsphere-cluster -n shardingsphere --set replicaCount=1 |
| kubectl wait --timeout=60s --for=condition=Ready --all pod -n shardingsphere |
| kubectl get pod -n shardingsphere --show-labels |
| kubectl get svc -n shardingsphere --show-labels |
| kubectl port-forward svc/shardingsphere-cluster 3307:3307 -n shardingsphere & |
| sleep 3 |
| - name: "prepare mysql" |
| uses: shogo82148/actions-setup-mysql@v1 |
| with: |
| mysql-version: '5.7' |
| - name: "run basic cmd test" |
| run: mysql -h127.0.0.1 -P3307 -uroot -proot -e 'SHOW DATABASES' |