Skip to content

Create AWS Quicksight samples using CDK #1479

Create AWS Quicksight samples using CDK

Create AWS Quicksight samples using CDK #1479

name: Build Pull Request
on: [pull_request]
jobs:
check_file_changes:
name: Check file changes
outputs:
has_csharp_changes: ${{ steps.check_files.outputs.has_csharp_changes }}
has_go_changes: ${{ steps.check_files.outputs.has_go_changes }}
has_java_changes: ${{ steps.check_files.outputs.has_java_changes }}
has_python_changes: ${{ steps.check_files.outputs.has_python_changes }}
has_typescript_changes: ${{ steps.check_files.outputs.has_typescript_changes }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Check files
id: check_files
run: |
echo "========== categorization of changed files =========="
for file in $(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }})
do
echo -n "$file => "
case $file in
csharp/*)
echo "C#"
echo "::set-output name=has_csharp_changes::true"
;;
go/*)
echo "Go"
echo "::set-output name=has_go_changes::true"
;;
java/*)
echo "Java"
echo "::set-output name=has_java_changes::true"
;;
python/*)
echo "Python"
echo "::set-output name=has_python_changes::true"
;;
typescript/*)
echo "TypeScript"
echo "::set-output name=has_typescript_changes::true"
;;
*)
echo "<unmatched>"
;;
esac
done
build:
needs: check_file_changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Runs docker builds with JSII superchain
run: |
HAS_CSHARP_CHANGES="${{needs.check_file_changes.outputs.has_csharp_changes}}"
HAS_GO_CHANGES="${{needs.check_file_changes.outputs.has_go_changes}}"
HAS_JAVA_CHANGES="${{needs.check_file_changes.outputs.has_java_changes}}"
HAS_PYTHON_CHANGES="${{needs.check_file_changes.outputs.has_python_changes}}"
HAS_TYPESCRIPT_CHANGES="${{needs.check_file_changes.outputs.has_typescript_changes}}"
if [ "${HAS_CSHARP_CHANGES}" == "true" ]; then
docker run --rm --net=host -t -v $PWD:$PWD -w $PWD jsii/superchain:1-buster-slim-node18 /bin/bash -c "scripts/build-csharp.sh"
fi
if [ "${HAS_GO_CHANGES}" == "true" ]; then
docker run --rm --net=host -t -v $PWD:$PWD -w $PWD jsii/superchain:1-buster-slim-node18 /bin/bash -c "scripts/build-go.sh"
fi
if [ "${HAS_JAVA_CHANGES}" == "true" ]; then
docker run --rm --net=host -t -v $PWD:$PWD -w $PWD jsii/superchain:1-buster-slim-node18 /bin/bash -c "scripts/build-java.sh"
fi
if [ "${HAS_PYTHON_CHANGES}" == "true" ]; then
docker run --rm --net=host -t -v $PWD:$PWD -w $PWD jsii/superchain:1-buster-slim-node18 /bin/bash -c "scripts/build-python.sh"
fi
if [ "${HAS_TYPESCRIPT_CHANGES}" == "true" ]; then
docker run --rm --net=host -t -v $PWD:$PWD -w $PWD jsii/superchain:1-buster-slim-node18 /bin/bash -c "scripts/build-typescript.sh"
fi