-
Notifications
You must be signed in to change notification settings - Fork 17
62 lines (56 loc) · 1.83 KB
/
wing-provider-specific.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Wing Provider Specific Tests
on:
push:
paths-ignore:
- '**/*.md'
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
env:
AWS_REGION : "us-east-1"
jobs:
setup:
runs-on: ubuntu-latest
outputs:
examples: ${{ steps.setdirs.outputs.dirs }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get list of directories
id: setdirs
shell: bash
run: |
dirs=$(ls -d examples/provider-specific/*/ | sed 's/\/$//' | jq -R -s -c 'split("\n")[:-1]')
processed_dirs=$(echo "{ \"directory\": $dirs }" | jq -c '[ .directory[] | {directory: ., name: (split("/") | last)}]')
wrapped_dirs=$(echo "{ \"example\": $processed_dirs }" | jq -c .)
echo "::set-output name=dirs::$wrapped_dirs"
test:
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.examples) }}
name: ${{ matrix.example.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
run: npm install -g winglang
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: gh-actions-winglang-examples
aws-region: ${{ env.AWS_REGION }}
- name: Execute test in matrix directory
run: cd ${{ matrix.example.directory }} && ./test.sh