generated from cloudposse-github-actions/composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (48 loc) · 7.03 KB
/
test-positive.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
name: Test atmos-affected-stacks positive
on:
# # Uncomment when test added first time to register workflow and comment it back after workflow would be registered
# #
# # Added pull_request to register workflow from the PR.
# # Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
# pull_request: {}
workflow_dispatch: {}
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Setup
run: echo "Do setup"
test:
runs-on: ubuntu-latest
needs: [setup]
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: add mock atmos to the path
run: echo "./fixtures" >> $GITHUB_PATH
- uses: ./
id: current
with:
install-atmos: false
atmos-config-path: "./components/terraform/test"
outputs:
affected: "${{ steps.current.outputs.affected }}"
matrix: "${{ steps.current.outputs.matrix }}"
assert:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: nick-fields/assert-action@v1
with:
expected: '[{"component":"datadog-integration","component_type":"terraform","component_path":"components/terraform/datadog-integration","stack":"core-ue2-root","stack_slug":"core-ue2-root-datadog-integration","affected":"component"},{"component":"datadog-integration","component_type":"terraform","component_path":"components/terraform/datadog-integration","stack":"core-gbl-audit","stack_slug":"core-gbl-audit-datadog-integration","affected":"component"},{"component":"datadog-integration","component_type":"terraform","component_path":"components/terraform/datadog-integration","stack":"core-gbl-auto","stack_slug":"core-gbl-auto-datadog-integration","spacelift_stack":"core-gbl-auto-datadog-integration","affected":"component"},{"component":"infrastructure-cplive-plat","component_type":"terraform","component_path":"components/terraform/spacelift","stack":"core-gbl-auto","stack_slug":"core-gbl-auto-infrastructure-cplive-plat","spacelift_stack":"core-gbl-auto-infrastructure-cplive-plat","affected":"stack.vars"},{"component":"infrastructure-cplive-core","component_type":"terraform","component_path":"components/terraform/spacelift","stack":"core-gbl-auto","stack_slug":"core-gbl-auto-infrastructure-cplive-core","spacelift_stack":"core-gbl-auto-infrastructure-cplive-core","affected":"stack.vars"},{"component":"datadog-integration","component_type":"terraform","component_path":"components/terraform/datadog-integration","stack":"plat-gbl-prod","stack_slug":"plat-gbl-prod-datadog-integration","spacelift_stack":"plat-gbl-prod-datadog-integration","affected":"component"}]'
actual: "${{ needs.test.outputs.affected }}"
- uses: nick-fields/assert-action@v1
with:
expected: '{"include":['
actual: "${{ needs.test.outputs.matrix }}"
comparison: contains
- uses: nick-fields/assert-action@v1
with:
expected: '{"include":[{"name":"core-analytics","items":"{\"include\":[{\"component\":\"datadog-integration\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/datadog-integration\",\"stack\":\"core-gbl-analytics\",\"stack_slug\":\"core-gbl-analytics-datadog-integration\",\"spacelift_stack\":\"core-gbl-analytics-datadog-integration\",\"affected\":\"component\"}]}"},{"name":"core-artifacts","items":"{\"include\":[{\"component\":\"datadog-integration\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/datadog-integration\",\"stack\":\"core-gbl-artifacts\",\"stack_slug\":\"core-gbl-artifacts-datadog-integration\",\"spacelift_stack\":\"core-gbl-artifacts-datadog-integration\",\"affected\":\"component\"}]}"},{"name":"core-audit","items":"{\"include\":[{\"component\":\"datadog-integration\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/datadog-integration\",\"stack\":\"core-gbl-audit\",\"stack_slug\":\"core-gbl-audit-datadog-integration\",\"affected\":\"component\"}]}"},{"name":"core-auto","items":"{\"include\":[{\"component\":\"datadog-integration\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/datadog-integration\",\"stack\":\"core-gbl-auto\",\"stack_slug\":\"core-gbl-auto-datadog-integration\",\"spacelift_stack\":\"core-gbl-auto-datadog-integration\",\"affected\":\"component\"},{\"component\":\"infrastructure-cplive-core\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/spacelift\",\"stack\":\"core-gbl-auto\",\"stack_slug\":\"core-gbl-auto-infrastructure-cplive-core\",\"spacelift_stack\":\"core-gbl-auto-infrastructure-cplive-core\",\"affected\":\"stack.vars\"},{\"component\":\"infrastructure-cplive-plat\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/spacelift\",\"stack\":\"core-gbl-auto\",\"stack_slug\":\"core-gbl-auto-infrastructure-cplive-plat\",\"spacelift_stack\":\"core-gbl-auto-infrastructure-cplive-plat\",\"affected\":\"stack.vars\"},{\"component\":\"acm\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/acm\",\"stack\":\"core-ue2-auto\",\"stack_slug\":\"core-ue2-auto-acm\",\"spacelift_stack\":\"core-ue2-auto-acm\",\"affected\":\"component\"},{\"component\":\"ecr\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/ecr\",\"stack\":\"core-ue2-auto\",\"stack_slug\":\"core-ue2-auto-ecr\",\"spacelift_stack\":\"core-ue2-auto-ecr\",\"affected\":\"stack.vars\"},{\"component\":\"eks/actions-runner-controller\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/eks/actions-runner-controller\",\"stack\":\"core-ue2-auto\",\"stack_slug\":\"core-ue2-auto-eks-actions-runner-controller\",\"spacelift_stack\":\"core-ue2-auto-eks-actions-runner-controller\",\"affected\":\"component\"},{\"component\":\"eks/actions-runner-controller/public\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/eks/actions-runner-controller\",\"stack\":\"core-ue2-auto\",\"stack_slug\":\"core-ue2-auto-eks-actions-runner-controller-public\",\"spacelift_stack\":\"core-ue2-auto-eks-actions-runner-controller-public\",\"affected\":\"component\"},{\"component\":\"eks/cluster\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/eks/cluster\",\"stack\":\"core-ue2-auto\",\"stack_slug\":\"core-ue2-auto-eks-cluster\",\"spacelift_stack\":\"core-ue2-auto-eks-cluster\",\"affected\":\"component\"},{\"component\":\"eks/karpenter-provisioner\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/eks/karpenter-provisioner\",\"stack\":\"core-ue2-auto\",\"stack_slug\":\"core-ue2-auto-eks-karpenter-provisioner\",\"spacelift_stack\":\"core-ue2-auto-eks-karpenter-provisioner\",\"affected\":\"stack.vars\"}]}"},{"name":"core-corp","items":"{\"include\":[{\"component\":\"datadog-integration\",\"component_type\":\"terraform\",\"component_path\":\"components/terraform/datadog-integration\",\"stack\":\"core-gbl-corp\",\"stack_slug\":\"core-gbl-corp-datadog-integration\",\"spacelift_st'
actual: "${{ needs.test.outputs.matrix }}"