diff --git a/.github/workflows/validate_new_quickstarts.yaml b/.github/workflows/validate_new_quickstarts.yaml new file mode 100644 index 00000000..69c045d3 --- /dev/null +++ b/.github/workflows/validate_new_quickstarts.yaml @@ -0,0 +1,171 @@ +# +# Copyright 2021 The Dapr Authors +# Licensed 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: Auto Validate New Quickstarts + +on: + workflow_dispatch: + push: + branches: + - master + - feature/new_quickstarts + - release-* + tags: + - v* + pull_request: + branches: + - master + - feature/new_quickstarts + - release-* +jobs: + deploy: + name: Validate quickstarts on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + env: + DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install + GOVER: 1.17 + KUBERNETES_VERSION: v1.21.1 + KIND_VERSION: v0.11.0 + KIND_IMAGE_SHA: sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 + strategy: + matrix: + os: [ubuntu-latest, macos-10.15] + steps: + - name: Install docker - MacOS + if: matrix.os == 'macos-10.15' + uses: docker-practice/actions-setup-docker@v1 + with: + docker_buildx: false + docker_version: 20.10 + - name: Configure KinD + if: matrix.os == 'ubuntu-latest' + # Generate a KinD configuration file that uses: + # A couple of worker nodes: this is needed to run both + # ZooKeeper + Kakfa + working-directory: ./ + run: | + cat > kind.yaml <> $GITHUB_ENV + - name: Set up Go ${{ env.GOVER }} + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GOVER }} + - name: Determine latest Dapr Runtime version including Pre-releases + run: | + helm repo add dapr https://dapr.github.io/helm-charts/ && helm repo update && export RUNTIME_VERSION=$(helm search repo dapr/dapr --devel --versions | awk '/dapr\/dapr/ {print $3; exit}' ) + echo "DAPR_RUNTIME_VERSION=$RUNTIME_VERSION" >> $GITHUB_ENV + echo "Found $RUNTIME_VERSION" + shell: bash + - name: Determine latest Dapr Cli version including Pre-releases + run: | + export CLI_VERSION=$(curl "https://api.github.com/repos/dapr/cli/releases?per_page=1&page=1" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | jq '.[0].tag_name'| tr -d '",v') + echo "DAPR_CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV + echo "Found $CLI_VERSION" + shell: bash + - name: Set up Dapr CLI - Mac/Linux + if: matrix.os != 'windows-latest' + run: wget -q ${{ env.DAPR_INSTALL_URL }}/install.sh -O - | /bin/bash -s ${{ env.DAPR_CLI_VERSION }} + - name: Set up Dapr CLI - Windows + if: matrix.os == 'windows-latest' + run: powershell -Command "\$$script=iwr -useb ${{ env.DAPR_INSTALL_URL }}/install.ps1; \$$block=[ScriptBlock]::Create(\$$script); invoke-command -ScriptBlock \$$block -ArgumentList ${{ env.DAPR_CLI_VERSION }}" + - name: Install Dapr + run: | + export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} + dapr init --runtime-version=${{ env.DAPR_RUNTIME_VERSION }} + dapr --version + - name: Install Dapr - Kubernetes + run: | + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo update + helm install redis bitnami/redis + dapr init -k --runtime-version=${{ env.DAPR_RUNTIME_VERSION }} --wait || kubectl get pods --all-namespaces + kubectl get nodes -o wide + for pod in `dapr status -k | awk '/dapr/ {print $1}'`; do kubectl describe pod -l app=$pod -n dapr-system ; kubectl logs -l app=$pod -n dapr-system; done + - name: Check out code + uses: actions/checkout@v2 + - name: Install utilities dependencies + run: | + echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV + pip3 install setuptools wheel + pip3 install mechanical-markdown + - name: Validate Go http pubsub + run: | + pushd pub_sub/go/http + make validate + popd + - name: Validate Go sdk pubsub + run: | + pushd pub_sub/go/sdk + make validate + popd + - name: Validate JS http pubsub + run: | + pushd pub_sub/javascript/http + make validate + popd + - name: Validate JS sdk pubsub + run: | + pushd pub_sub/javascript/sdk + make validate + popd + - name: Validate python http pubsub + run: | + pushd pub_sub/python/http + make validate + popd + - name: Validate python sdk pubsub + run: | + pushd pub_sub/python/sdk + make validate + popd + - name: Linkcheck README.md + run: | + make validate diff --git a/pub_sub/csharp/http/makefile b/pub_sub/csharp/http/makefile new file mode 100644 index 00000000..4e5966da --- /dev/null +++ b/pub_sub/csharp/http/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=csharp-http- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file diff --git a/pub_sub/csharp/sdk/makefile b/pub_sub/csharp/sdk/makefile new file mode 100644 index 00000000..cc9c6476 --- /dev/null +++ b/pub_sub/csharp/sdk/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=csharp-sdk- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file diff --git a/pub_sub/go/http/README.md b/pub_sub/go/http/README.md index e004ffeb..74ebf793 100644 --- a/pub_sub/go/http/README.md +++ b/pub_sub/go/http/README.md @@ -32,11 +32,9 @@ go build app.go \ No newline at end of file + + +```bash +dapr stop --app-id checkout +dapr stop --app-id order-processor +``` \ No newline at end of file diff --git a/pub_sub/go/http/makefile b/pub_sub/go/http/makefile new file mode 100644 index 00000000..02c1386f --- /dev/null +++ b/pub_sub/go/http/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=go-http- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file diff --git a/pub_sub/go/sdk/README.md b/pub_sub/go/sdk/README.md index 59d1dc7a..83a1a013 100644 --- a/pub_sub/go/sdk/README.md +++ b/pub_sub/go/sdk/README.md @@ -32,11 +32,9 @@ go build app.go + +```bash +dapr stop --app-id checkout +dapr stop --app-id order-processor +``` diff --git a/pub_sub/go/sdk/makefile b/pub_sub/go/sdk/makefile new file mode 100644 index 00000000..45746916 --- /dev/null +++ b/pub_sub/go/sdk/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=go-sdk- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file diff --git a/pub_sub/java/http/README.md b/pub_sub/java/http/README.md index c1720aa6..d84549a0 100644 --- a/pub_sub/java/http/README.md +++ b/pub_sub/java/http/README.md @@ -42,11 +42,9 @@ mvn clean install \ No newline at end of file + + +```bash +dapr stop --app-id checkout +dapr stop --app-id order-processor +``` \ No newline at end of file diff --git a/pub_sub/java/http/checkout/pom.xml b/pub_sub/java/http/checkout/pom.xml index 6eb404b4..e0207e47 100644 --- a/pub_sub/java/http/checkout/pom.xml +++ b/pub_sub/java/http/checkout/pom.xml @@ -34,6 +34,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.6.4 diff --git a/pub_sub/java/http/makefile b/pub_sub/java/http/makefile new file mode 100644 index 00000000..e18a6987 --- /dev/null +++ b/pub_sub/java/http/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=java-http- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file diff --git a/pub_sub/java/http/order-processor/pom.xml b/pub_sub/java/http/order-processor/pom.xml index 092146c5..5a2081c8 100644 --- a/pub_sub/java/http/order-processor/pom.xml +++ b/pub_sub/java/http/order-processor/pom.xml @@ -24,6 +24,7 @@ org.projectlombok lombok + 1.18.22 true @@ -32,6 +33,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.6.4 diff --git a/pub_sub/java/sdk/README.md b/pub_sub/java/sdk/README.md index 63417fbf..e166f379 100644 --- a/pub_sub/java/sdk/README.md +++ b/pub_sub/java/sdk/README.md @@ -43,11 +43,9 @@ mvn clean install name: Run Java publisher working_dir: ./checkout expected_stdout_lines: - - "You're up and running! Both Dapr and your app logs will appear here." - 'Published data: 1' - 'Published data: 2' - "Exited App successfully" - - "Exited Dapr successfully" expected_stderr_lines: output_match_mode: substring background: true @@ -55,7 +53,7 @@ sleep: 10 --> ```bash - dapr run --app-id checkout --components-path ../../components -- java -jar target/CheckoutService-0.0.1-SNAPSHOT.jar + dapr run --app-id checkout --components-path ../../../components -- java -jar target/CheckoutService-0.0.1-SNAPSHOT.jar ``` @@ -78,9 +76,7 @@ mvn clean install name: Run Java publisher working_dir: ./order-processor expected_stdout_lines: - - "You're up and running! Both Dapr and your app logs will appear here." - 'Subscriber received: 2' - - "Exited Dapr successfully" - "Exited App successfully" expected_stderr_lines: output_match_mode: substring @@ -88,6 +84,11 @@ background: true sleep: 10 --> ```bash - dapr run --app-port 8080 --app-id order-processor --components-path ../../components -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar + dapr run --app-port 8080 --app-id order-processor --components-path ../../../components -- java -jar target/OrderProcessingService-0.0.1-SNAPSHOT.jar ``` - \ No newline at end of file + + +```bash +dapr stop --app-id checkout +dapr stop --app-id order-processor +``` \ No newline at end of file diff --git a/pub_sub/java/sdk/checkout/pom.xml b/pub_sub/java/sdk/checkout/pom.xml index 60e49c63..9d000949 100644 --- a/pub_sub/java/sdk/checkout/pom.xml +++ b/pub_sub/java/sdk/checkout/pom.xml @@ -36,7 +36,7 @@ org.projectlombok lombok - 1.18.16 + 1.18.22 true @@ -46,6 +46,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.6.4 diff --git a/pub_sub/java/sdk/makefile b/pub_sub/java/sdk/makefile new file mode 100644 index 00000000..5b27b054 --- /dev/null +++ b/pub_sub/java/sdk/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=java-sdk- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file diff --git a/pub_sub/java/sdk/order-processor/pom.xml b/pub_sub/java/sdk/order-processor/pom.xml index c263e1b0..43a80750 100644 --- a/pub_sub/java/sdk/order-processor/pom.xml +++ b/pub_sub/java/sdk/order-processor/pom.xml @@ -34,6 +34,7 @@ org.projectlombok lombok + 1.18.22 true @@ -43,6 +44,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.6.4 org.apache.maven.plugins diff --git a/pub_sub/javascript/http/README.md b/pub_sub/javascript/http/README.md index 32ebeb89..858a6120 100644 --- a/pub_sub/javascript/http/README.md +++ b/pub_sub/javascript/http/README.md @@ -32,11 +32,9 @@ npm install \ No newline at end of file + + +```bash +dapr stop --app-id checkout +dapr stop --app-id order-processor +``` \ No newline at end of file diff --git a/pub_sub/javascript/http/makefile b/pub_sub/javascript/http/makefile new file mode 100644 index 00000000..cf01c067 --- /dev/null +++ b/pub_sub/javascript/http/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=javascript-http- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file diff --git a/pub_sub/javascript/sdk/README.md b/pub_sub/javascript/sdk/README.md index bf071810..862064d4 100644 --- a/pub_sub/javascript/sdk/README.md +++ b/pub_sub/javascript/sdk/README.md @@ -32,11 +32,9 @@ npm install \ No newline at end of file + + +```bash +dapr stop --app-id checkout +dapr stop --app-id order-processor +``` \ No newline at end of file diff --git a/pub_sub/javascript/sdk/makefile b/pub_sub/javascript/sdk/makefile new file mode 100644 index 00000000..1ba86dd5 --- /dev/null +++ b/pub_sub/javascript/sdk/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=javascript-sdk- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file diff --git a/pub_sub/python/http/README.md b/pub_sub/python/http/README.md index 4e4bc6e1..92612b34 100644 --- a/pub_sub/python/http/README.md +++ b/pub_sub/python/http/README.md @@ -32,11 +32,9 @@ pip3 install -r requirements.txt + +```bash +dapr stop --app-id checkout +dapr stop --app-id order-processor +``` diff --git a/pub_sub/python/http/makefile b/pub_sub/python/http/makefile new file mode 100644 index 00000000..e8f549b8 --- /dev/null +++ b/pub_sub/python/http/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=python-http- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file diff --git a/pub_sub/python/sdk/README.md b/pub_sub/python/sdk/README.md index bcb619e2..ee064d8d 100644 --- a/pub_sub/python/sdk/README.md +++ b/pub_sub/python/sdk/README.md @@ -33,11 +33,9 @@ pip3 install -r requirements.txt + +```bash +dapr stop --app-id checkout +dapr stop --app-id order-processor +``` diff --git a/pub_sub/python/sdk/makefile b/pub_sub/python/sdk/makefile new file mode 100644 index 00000000..beaf007a --- /dev/null +++ b/pub_sub/python/sdk/makefile @@ -0,0 +1,5 @@ +DOCKER_IMAGE_PREFIX ?=python-sdk- +APPS ?=checkout order-processor + +include ../../../docker.mk +include ../../../validate.mk \ No newline at end of file