Skip to content

Commit c42f1ed

Browse files
committed
Get modules dynamically
1 parent 889c011 commit c42f1ed

File tree

1 file changed

+13
-66
lines changed

1 file changed

+13
-66
lines changed

.github/workflows/ci.yml

+13-66
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ env:
33
AWS_EC2_METADATA_DISABLED: true
44

55
jobs:
6+
get-modules:
7+
runs-on: ubuntu-20.04
8+
outputs:
9+
matrix: ${{steps.list_dirs.outputs.matrix}}
10+
# Modified from https://stackoverflow.com/a/67180216 to filter just directory names
11+
# and to filter out scripts dir and to disables bless-ca
12+
steps:
13+
- uses: actions/checkout@v2
14+
- id: list_dirs
15+
run: echo "::set-output name=matrix::$(ls -d */|sed -e 's/\///'|grep -v 'bless-ca\|scripts'|jq -cnR '[inputs | select(length>0)]')"
16+
617
check-mod:
718
name: check-mod
819
runs-on: ubuntu-latest
@@ -30,75 +41,11 @@ jobs:
3041
test:
3142
name: test ${{ matrix.module }}
3243
runs-on: ubuntu-latest
44+
needs: get-modules
3345
strategy:
3446
fail-fast: false
3547
matrix:
36-
module:
37-
- aws-acm-cert
38-
- aws-aurora
39-
- aws-aurora-mysql
40-
- aws-aurora-postgres
41-
- aws-cloudfront-domain-redirect
42-
- aws-cloudfront-logs-bucket
43-
- aws-cloudwatch-log-group
44-
- aws-cloudwatch-log-retention-manager
45-
- aws-default-vpc-security
46-
- aws-ecs-job
47-
- aws-ecs-job-fargate
48-
- aws-ecs-service
49-
- aws-ecs-service-fargate
50-
- aws-efs-volume
51-
- aws-iam-ecs-task-role
52-
- aws-iam-group-assume-role
53-
- aws-iam-group-console-login
54-
- aws-iam-instance-profile
55-
- aws-iam-password-policy
56-
- aws-iam-policy-cwlogs
57-
- aws-iam-role
58-
- aws-iam-role-bless
59-
- aws-iam-role-cloudfront-poweruser
60-
- aws-iam-role-crossacct
61-
- aws-iam-role-ec2-poweruser
62-
- aws-iam-role-ecs-poweruser
63-
- aws-iam-role-infraci
64-
- aws-iam-role-poweruser
65-
- aws-iam-role-readonly
66-
- aws-iam-role-route53domains-poweruser
67-
- aws-iam-role-security-audit
68-
- aws-iam-secrets-reader-policy
69-
- aws-lambda-edge-add-security-headers
70-
- aws-lambda-function
71-
- aws-param
72-
- aws-params-reader-policy
73-
- aws-params-secrets-setup
74-
- aws-params-writer
75-
- aws-redis-node
76-
- aws-redis-replication-group
77-
- aws-s3-private-bucket
78-
- aws-s3-public-bucket
79-
- aws-single-page-static-site
80-
- aws-sns-lambda
81-
- aws-ssm-params
82-
- aws-ssm-params-writer
83-
# - bless-ca/test
84-
- github-webhooks-to-s3
85-
- module-template
86-
- snowflake-account-grant-all
87-
- snowflake-database-grant-all
88-
- snowflake-external-table-grant-all
89-
- snowflake-file-format-grant-all
90-
- snowflake-function-grant-all
91-
- snowflake-integration-grant-all
92-
- snowflake-materialized-view-grant-all
93-
- snowflake-procedure-grant-all
94-
- snowflake-resource-monitor-grant-all
95-
- snowflake-schema-grant-all
96-
- snowflake-sequence-grant-all
97-
- snowflake-stage-grant-all
98-
- snowflake-stream-grant-all
99-
- snowflake-table-grant-all
100-
- snowflake-view-grant-all
101-
- snowflake-warehouse-grant-all
48+
module: ${{fromJson(needs.get-modules.outputs.matrix)}}
10249
steps:
10350
- uses: actions/checkout@v2
10451
- id: filter

0 commit comments

Comments
 (0)