mirror of https://github.com/dapr/quickstarts.git
108 lines
3.7 KiB
YAML
108 lines
3.7 KiB
YAML
#
|
|
# Copyright 2023 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: Validate csharp quickstart
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
- feature/new_quickstarts
|
|
- release-*
|
|
tags:
|
|
- v*
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- feature/new_quickstarts
|
|
- release-*
|
|
jobs:
|
|
validate:
|
|
name: Validate C# quickstart on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 60
|
|
env:
|
|
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install
|
|
GOVER: 1.18
|
|
KUBERNETES_VERSION: v1.25.3
|
|
KIND_VERSION: v0.17.0
|
|
KIND_IMAGE_SHA: sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest]
|
|
fail-fast: false
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v2
|
|
- name: Load environment variables
|
|
uses: artursouza/export-env-action@v2
|
|
with:
|
|
envFile: './.github/env/global.env'
|
|
expand: 'true'
|
|
- name: Install .NET Core
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: |
|
|
7.0.x
|
|
- 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: Upgrade pip and setuptools
|
|
if: matrix.os == 'macos-latest'
|
|
run: pip3 install --upgrade pip && python3 -m pip install --upgrade setuptools
|
|
- name: Install docker - MacOS
|
|
if: matrix.os == 'macos-latest'
|
|
uses: docker-practice/actions-setup-docker@v1
|
|
with:
|
|
docker_buildx: false
|
|
docker_version: 20.10
|
|
- name: Install Dapr
|
|
run: |
|
|
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
|
dapr init --runtime-version=${{ env.DAPR_RUNTIME_VERSION }}
|
|
dapr --version
|
|
- name: Install utilities dependencies
|
|
run: |
|
|
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
|
|
pip3 install setuptools wheel
|
|
pip3 install mechanical-markdown
|
|
- name: Set up Postgres
|
|
run: |
|
|
pushd bindings/db/
|
|
docker compose up -d
|
|
popd
|
|
- name: Validate building blocks with C#
|
|
run: |
|
|
variants=("http" "sdk")
|
|
building_blocks=$(find . -maxdepth 1 -mindepth 1 -type d)
|
|
for building_block in $building_blocks; do
|
|
for variant in "${variants[@]}"
|
|
do
|
|
if [ ! -d "$building_block/csharp/$variant" ];
|
|
then
|
|
echo "$building_block/csharp/$variant does not exist."
|
|
else
|
|
pushd $building_block/csharp/$variant
|
|
echo "Validating $building_block/csharp/$variant quickstart"
|
|
make validate
|
|
popd
|
|
fi
|
|
done
|
|
done
|
|
- name: Linkcheck README.md
|
|
run: |
|
|
make validate |