generated from cloudposse-github-actions/composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (90 loc) · 2.75 KB
/
build-and-test.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: build-and-test
on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
push:
branches:
- main
jobs:
check-dist:
name: "check-dist matches source"
uses: cloudposse/github-actions-workflows/.github/workflows/ci-typescript-app-check-dist.yml@main
with:
node-version: 20.x
unit-test:
name: "unit tests"
runs-on: ubuntu-latest
needs: check-dist
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --prefer-offline
- uses: cloudposse/github-action-setup-atmos@v2
with:
install-wrapper: false
- name: run unit tests
run: yarn test
integration-test-single:
name: "integration test: single setting"
runs-on: ubuntu-latest
needs: check-dist
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: yarn
- uses: cloudposse/github-action-setup-atmos@v2
with:
install-wrapper: false
- uses: ./
id: get-setting
with:
component: foo
stack: core-ue1-dev
settings-path: atmos_cli_config.components.terraform.base_path
- uses: nick-fields/assert-action@v2
with:
expected: "components/terraform"
actual: ${{ steps.get-setting.outputs.value}}
integration-test-multiple:
name: "integration test: multiple settings"
runs-on: ubuntu-latest
needs: check-dist
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: yarn
- uses: cloudposse/github-action-setup-atmos@v2
with:
install-wrapper: false
- uses: ./
id: get-setting
with:
settings: |
- component: foo
stack: core-ue1-dev
settingsPath: atmos_cli_config.components.terraform.base_path
outputPath: prop1
- component: foo
stack: core-ue1-dev
settingsPath: settings.level1.level2.level3.secrets-arn
outputPath: prop2
- uses: nick-fields/assert-action@v2
with:
expected: '{"prop1":"components/terraform","prop2":"arn:aws:secretsmanager:us-east-1:000000000000:secret:MySecret-PlMes3"}'
actual: ${{ steps.get-setting.outputs.settings}}