|
| 1 | +name: Test Cloud |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +concurrency: |
| 7 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 8 | + cancel-in-progress: true |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-ferrctl: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v3 |
| 15 | + |
| 16 | + - name: Set up Go |
| 17 | + uses: actions/setup-go@v2 |
| 18 | + with: |
| 19 | + go-version: 1.18 |
| 20 | + |
| 21 | + - run: | |
| 22 | + go build -o ferryctl ./cmd/ferryctl |
| 23 | +
|
| 24 | + - name: Upload ferryctl |
| 25 | + uses: actions/upload-artifact@v2 |
| 26 | + with: |
| 27 | + name: ferryctl |
| 28 | + path: ferryctl |
| 29 | + |
| 30 | + test-cloud: |
| 31 | + continue-on-error: true |
| 32 | + strategy: |
| 33 | + matrix: |
| 34 | + cloud: |
| 35 | + - aliyun |
| 36 | + - aws |
| 37 | + - azure |
| 38 | + - gcp |
| 39 | + runs-on: ubuntu-latest |
| 40 | + needs: |
| 41 | + - build-ferrctl |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v3 |
| 44 | + |
| 45 | + - name: Download for ferryctl |
| 46 | + uses: actions/download-artifact@v2 |
| 47 | + with: |
| 48 | + name: ferryctl |
| 49 | + |
| 50 | + - name: Set up ferryctl |
| 51 | + run: | |
| 52 | + cp ferryctl /usr/local/bin/ferryctl && chmod +x /usr/local/bin/ferryctl |
| 53 | +
|
| 54 | + - name: Set up eksctl |
| 55 | + if: matrix.cloud == 'aws' |
| 56 | + run: | |
| 57 | + wget -O eksctl.tar.gc "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_linux_amd64.tar.gz" |
| 58 | + tar -xzf eksctl.tar.gz -C /tmp/ && mv /tmp/eksctl /usr/local/bin/ && chmod +x /usr/local/bin/eksctl |
| 59 | +
|
| 60 | + - name: Set up gcloud |
| 61 | + if: matrix.cloud == 'gcp' |
| 62 | + uses: google-github-actions/setup-gcloud@v0 |
| 63 | + with: |
| 64 | + install_components: 'gke-gcloud-auth-plugin' |
| 65 | + |
| 66 | + - name: Login ${{ matrix.cloud }} |
| 67 | + run: | |
| 68 | + ./test/cloud/${{ matrix.cloud }}/login.sh |
| 69 | + ./test/cloud/${{ matrix.cloud }}/list.sh |
| 70 | + env: |
| 71 | + ALIYUN_ACCESS_KEY_ID: ${{ secrets.ALIYUN_ACCESS_KEY_ID }} |
| 72 | + ALIYUN_ACCESS_KEY_SECRET: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }} |
| 73 | + ALIYUN_REGION_ID: ${{ secrets.ALIYUN_REGION_ID }} |
| 74 | + ALIYUN_ZONE_ID: ${{ secrets.ALIYUN_ZONE_ID }} |
| 75 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 76 | + AWS_ACCESS_KEY_SECRET: ${{ secrets.AWS_ACCESS_KEY_SECRET }} |
| 77 | + AWS_REGION_ID: ${{ secrets.AWS_REGION_ID }} |
| 78 | + AWS_ZONE_ID: ${{ secrets.AWS_ZONE_ID }} |
| 79 | + AZURE_APP_ID: ${{ secrets.AZURE_APP_ID }} |
| 80 | + AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }} |
| 81 | + AZURE_TENANT: ${{ secrets.AZURE_TENANT }} |
| 82 | + AZURE_REGION_ID: ${{ secrets.AZURE_REGION_ID }} |
| 83 | + AZURE_ZONE_ID: ${{ secrets.AZURE_ZONE_ID }} |
| 84 | + GCP_CRED_DATA: ${{ secrets.GCP_CRED_DATA }} |
| 85 | + GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} |
| 86 | + GCP_REGION_ID: ${{ secrets.GCP_REGION_ID }} |
| 87 | + GCP_ZONE_ID: ${{ secrets.GCP_ZONE_ID }} |
| 88 | + - name: Start cluster |
| 89 | + run: | |
| 90 | + ./test/hack/start-environment.sh cloud-${{ matrix.cloud }} |
| 91 | +
|
| 92 | + - name: Test control-plane and cluster-${{ matrix.cloud }} |
| 93 | + run: ./test/test/test-in-both-easy.sh |
| 94 | + env: |
| 95 | + ROUTE_NAME: ferry-test |
| 96 | + CONTROL_PLANE: control-plane |
| 97 | + CLUSTER_1: cluster-${{ matrix.cloud }} |
| 98 | + CLUSTER_2: control-plane |
| 99 | + TARGET_1: web-${{ matrix.cloud }} |
| 100 | + TARGET_2: web-0 |
| 101 | + |
| 102 | + - name: Clean cluster |
| 103 | + run: | |
| 104 | + ./test/hack/clean-environment.sh cloud-${{ matrix.cloud }} |
0 commit comments