|
| 1 | +name: Acception Tests CI/CD |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "**" |
| 7 | + tags-ignore: |
| 8 | + - "*.*" |
| 9 | + pull_request: |
| 10 | +jobs: |
| 11 | + acc: |
| 12 | + name: Acception Tests |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Set up Go 1.x |
| 16 | + uses: actions/setup-go@v2 |
| 17 | + with: |
| 18 | + go-version: ^1.14 |
| 19 | + id: go |
| 20 | + |
| 21 | + - name: Get dependencies |
| 22 | + run: | |
| 23 | + SWAGGER_VERSION=v0.23.0 |
| 24 | + mkdir -p $HOME/bin |
| 25 | + curl -Lo $HOME/bin/swagger https://github.com/go-swagger/go-swagger/releases/download/${SWAGGER_VERSION}/swagger_linux_amd64 \ |
| 26 | + && chmod +x $HOME/bin/swagger |
| 27 | + echo "::add-path::$HOME/bin" |
| 28 | +
|
| 29 | + - name: Use Node.js |
| 30 | + uses: actions/setup-node@v1 |
| 31 | + with: |
| 32 | + node-version: 12.x |
| 33 | + |
| 34 | + - name: npm install swagger-merger |
| 35 | + run: | |
| 36 | + npm install swagger-merger -g |
| 37 | +
|
| 38 | + - name: Check out code into the Go module directory |
| 39 | + uses: actions/checkout@v2 |
| 40 | + |
| 41 | + - name: install golangci-lint |
| 42 | + run: | |
| 43 | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0 |
| 44 | +
|
| 45 | + - name: test provider |
| 46 | + run: | |
| 47 | + make generate |
| 48 | +
|
| 49 | + #- name: setup Docker |
| 50 | + # uses: docker-practice/actions-setup-docker@master |
| 51 | + # with: |
| 52 | + # docker_version: 19.09 |
| 53 | + # docker_channel: stable |
| 54 | + #- name: Test |
| 55 | + # run: | |
| 56 | + # set -x |
| 57 | + # docker version |
| 58 | + # cat /etc/docker/daemon.json |
| 59 | + # docker buildx version || true |
| 60 | + # docker buildx ls || true |
| 61 | + # https://github.com/engineerd/setup-kind |
| 62 | + - uses: engineerd/[email protected] |
| 63 | + with: |
| 64 | + skipClusterCreation: true |
| 65 | + |
| 66 | + - name: Starting the Kind Cluster |
| 67 | + run: | |
| 68 | + ./scripts/tst-00-prepare-kind.sh |
| 69 | +
|
| 70 | + - name: Testing |
| 71 | + run: | |
| 72 | + kind export kubeconfig |
| 73 | + kubectl cluster-info |
| 74 | + kubectl get pods -n kube-system |
| 75 | + NODEDNSNAME=$(kubectl get nodes -ojson | jq '.items[0].status.addresses[0].address' -r | sed 's/\./-/g') |
| 76 | + echo "::set-env name=INGRESS_DOMAIN::${NODEDNSNAME}.sslip.io" |
| 77 | + echo "current-context:" $(kubectl config current-context) |
| 78 | + echo "environment-kubeconfig:" ${KUBECONFIG} |
| 79 | +
|
| 80 | + - name: install helm3 |
| 81 | + run: | |
| 82 | + curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash |
| 83 | +
|
| 84 | + - name: install harbor |
| 85 | + run: | |
| 86 | + ./scripts/tst-01-prepare-harbor.sh ${INGRESS_DOMAIN} "1.4.0" |
| 87 | + #- name: install harbor |
| 88 | + # run: | |
| 89 | + # echo "::set-env name=INGRESS_DOMAIN::harbor.${NODEDNSNAME}.sslip.io" |
| 90 | + |
| 91 | + - name: Starting the Acc |
| 92 | + run: | |
| 93 | + ./scripts/tst-15-execute-go-acc.sh "/api/v2.0" |
| 94 | +
|
| 95 | + - name: remove the kind cluster |
| 96 | + if: ${{ always() }} |
| 97 | + run: | |
| 98 | + kind delete cluster |
| 99 | +
|
| 100 | +# |
0 commit comments