-
Notifications
You must be signed in to change notification settings - Fork 39
133 lines (105 loc) · 3.93 KB
/
Copy pathtests.yml
File metadata and controls
133 lines (105 loc) · 3.93 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: tests
on: push
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Node 24
uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1.4.6
with:
node-version: 24
- name: Enable Corepack
run: corepack enable
- name: Cache Node modules
id: cache-node-modules
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ matrix.working-dir }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --immutable
- name: Synthesize project files
run: yarn projen
- name: Anti-tamper check
run: |-
if ! git diff --exit-code; then
echo "Do not directly edit the project files generated by Projen. Add your changes to '.projenrc.ts' then run 'yarn projen'."
exit 1
fi
- name: Check formatting
run: yarn check-formatting
- name: Lint
run: yarn eslint
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
node-version: [22, 24]
steps:
- name: Checkout
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node-version }}
- name: Enable Corepack
run: corepack enable
- name: Cache Node modules
id: cache-node-modules
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ matrix.working-dir }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --immutable
- name: Run tests
run: yarn test
integration-tests:
needs: [lint, test]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Node 24
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
with:
node-version: 24
- name: Enable Corepack
run: corepack enable
- name: Cache Node modules
id: cache-node-modules
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --immutable
- name: Build
run: yarn build
- name: Install CDK CLI
run: sudo npm install -g aws-cdk
- name: Install Packages
run: yarn projen
- name: Configure AWS credentials via OIDC (Build-Stable)
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
role-to-assume: arn:aws:iam::486234852809:role/datadog-cdk-constructs-github-actions
aws-region: us-east-1
- name: Configure AWS credentials for Serverless Sandbox
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
role-to-assume: arn:aws:iam::425362996713:role/gha-datadog-cdk-integration-test
aws-region: us-east-1
role-chaining: true
role-skip-session-tagging: true
- name: Run tests
run: ./scripts/run_integration_tests.sh