Skip to content

Commit

Permalink
Run CI on all changed modules, not just the first one. (#281)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrick Cloke <[email protected]>
  • Loading branch information
clokep and Patrick Cloke authored Aug 15, 2024
1 parent cb1c84d commit 63b8838
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/module-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
set -x
# Get all the modules that have the file "deployspec.yaml"
MODULES=$(echo $ALL_CHANGED_FILES | cut -d/ -f 2-3 | uniq)
# Get all the modules that have files which have changed.
MODULES=$(echo $ALL_CHANGED_FILES | tr ' ' '\n' | cut -d/ -f 2-3 | uniq)
# Create our json structure [{"module_name": "..."}]
MODULES_JSON=$(echo "$MODULES" | jq -R -s 'split("\n")' | jq '[ .[] | select(length > 0) ]' | jq 'map({"module_name": .})')
# Export the modules as json to the outputs
Expand Down
2 changes: 1 addition & 1 deletion modules/integration/fsx-lustre-on-eks/stack_fsx_eks.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def __init__(
"command": ["/bin/sh", "-c"],
"args": [
f"chmod -R 777 {dra_export_path}",
f"chown -R root:users {dra_export_path}"
f"chown -R root:users {dra_export_path}",
],
"volumeMounts": [
{
Expand Down
2 changes: 2 additions & 0 deletions modules/integration/fsx-lustre-on-eks/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def stack_defaults():
os.environ["SEEDFARMER_PARAMETER_FSX_MOUNT_NAME"] = "asdf"
os.environ["SEEDFARMER_PARAMETER_FSX_DNS_NAME"] = "asfsad"
os.environ["SEEDFARMER_PARAMETER_FSX_STORAGE_CAPACITY"] = "1200"
os.environ["SEEDFARMER_PARAMETER_EKS_HANDLER_ROLE_ARN"] = "arn:aws:iam:::role/y"
os.environ["SEEDFARMER_PARAMETER_DRA_EXPORT_PATH"] = "/test/path"
os.environ["EKS_NAMESPACE"] = "namespace"
os.environ["CDK_DEFAULT_ACCOUNT"] = "111111111111"
os.environ["CDK_DEFAULT_REGION"] = "us-east-1"
Expand Down
2 changes: 2 additions & 0 deletions modules/integration/fsx-lustre-on-eks/tests/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def test_synthesize_stack(stack_defaults):
fsx_mount_name="foobar",
fsx_dns_name="example.com",
fsx_storage_capacity="1200Gi",
eks_handler_role_arn="arn:aws:iam::123456789012:role/eks-handler-role",
eks_namespace="service.example.com",
dra_export_path="/test/path",
env=cdk.Environment(
account=os.environ["CDK_DEFAULT_ACCOUNT"],
region=os.environ["CDK_DEFAULT_REGION"],
Expand Down
8 changes: 4 additions & 4 deletions modules/storage/fsx-lustre/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ def __init__(
)

# Configure DRA for FSx
if dra_import_path and dra_export_path:
dra_s3_import_path = f"s3://{data_bucket_name}{dra_import_path}" if dra_import_path else None
dra_s3_export_path = f"s3://{data_bucket_name}{dra_export_path}" if dra_export_path else None

if dra_import_path:
dra_s3_import_path = f"s3://{data_bucket_name}{dra_import_path}"
_dra_import = fsx.CfnDataRepositoryAssociation(
self,
"ImportPathDRA",
Expand All @@ -126,6 +124,8 @@ def __init__(
),
),
)
if dra_export_path:
dra_s3_export_path = f"s3://{data_bucket_name}{dra_export_path}"
_dra_export = fsx.CfnDataRepositoryAssociation(
self,
"ExportPathDRA",
Expand Down

0 comments on commit 63b8838

Please sign in to comment.