Wing 0.33.6 #341
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SDK Spec AWS Tests | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: {} | |
env: | |
AWS_REGION: "us-east-1" | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Get list of directories | |
id: setdirs | |
shell: bash | |
run: | | |
dirs=$(ls -d examples/tests/sdk_tests/*/ | sed 's/\/$//' | grep -v "external" | jq -R -s -c 'split("\n")[:-1]') | |
processed_dirs=$(echo "{ \"directory\": $dirs }" | jq -c '[ .directory[] | {directory: ., name: (split("/") | last)}]') | |
wrapped_dirs=$(echo "{ \"test\": $processed_dirs }" | jq -c .) | |
echo "DIRS=$wrapped_dirs" >> $GITHUB_ENV | |
- name: Pass environment variable to output | |
id: passenv | |
run: | | |
echo "::set-output name=dirs::$DIRS" | |
outputs: | |
tests: ${{ steps.passenv.outputs.dirs }} | |
test-tf-aws: | |
needs: setup | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.setup.outputs.tests) }} | |
name: ${{ matrix.test.name }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js v18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install winglang globally | |
uses: nick-fields/retry@v2 | |
with: | |
max_attempts: 3 | |
retry_on: error | |
timeout_minutes: 5 | |
command: npm install -g winglang | |
- name: Installing external js modules | |
run: | | |
cd examples/tests/sdk_tests | |
npm install | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Execute wing test in matrix directory | |
uses: nick-fields/retry@v2 | |
env: | |
TF_LOG: info | |
TF_LOG_PATH: ${{ runner.workspace }}/terraform.log | |
with: | |
max_attempts: 3 | |
retry_on: error | |
timeout_minutes: 20 | |
command: wing test -t tf-aws ${{ matrix.test.directory }}/*.w | |
- name: Output Terraform log | |
if: failure() | |
run: cat ${{ runner.workspace }}/terraform.log |