Skip to content

fix: change repository links in the readme file #27

fix: change repository links in the readme file

fix: change repository links in the readme file #27

Workflow file for this run

name: "Test Latest Updated Templates"
on:
pull_request:
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
templates: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
sap-cap-javascript-node: ./**/sap-cap-javascript-node/**
test:
needs: [detect-changes]
runs-on: ubuntu-latest
if: ${{ needs.detect-changes.outputs.templates != '[]' && needs.detect-changes.outputs.templates != '' }}
continue-on-error: true
strategy:
matrix:
template: ${{ fromJSON(needs.detect-changes.outputs.templates) }}
steps:
- uses: actions/checkout@v2
- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
- name: "Generating tests for '${{ matrix.template }}'"
run: echo "${{ matrix.template }}"
- name: "Run smoke tests for '${{ matrix.template }}'"
run: |
set -e
cd src/${{ matrix.template }}
# Configure templates only if `devcontainer-template.json` contains the `options` property.
optionProp=( $(jq -r '.options' devcontainer-template.json) )
if [ "${optionProp}" != "" ] && [ "${optionProp}" != "null" ] ; then
options=( $(jq -r '.options | keys[]' devcontainer-template.json) )
if [ "${options[0]}" != "" ] && [ "${options[0]}" != "null" ] ; then
echo "(!) Configuring template options within 'src/${{ matrix.template }}' folder"
for option in "${options[@]}"
do
# Get default variant for current template
option_key="\${templateOption:$option}"
option_value=$(jq -r ".options | .${option} | .default" devcontainer-template.json)
if [ "${option_value}" = "" ] || [ "${option_value}" = "null" ] ; then
echo "Template '${{ matrix.template }}' is missing a default value for option '${option}'"
exit 1
fi
# Execute test for the default variant of that template
VARIANT="$option_value" ../../test/${{ matrix.template }}/test.sh
done
fi
fi