-
Notifications
You must be signed in to change notification settings - Fork 85
144 lines (130 loc) · 3.82 KB
/
ci.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
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
134
135
136
137
138
139
140
141
142
143
144
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
name: Java ${{ matrix.java }} ${{ matrix.os }}
strategy:
matrix:
java: [17]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'corretto'
- name: clean and build
run: ./gradlew clean build -Plog-tests
protocol-tests:
runs-on: ${{ matrix.os }}
name: Protocol Tests
strategy:
matrix:
java: [17]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'corretto'
- name: clean and build
run: ./gradlew clean build -Plog-tests
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Run protocol tests
run: yarn test:protocols
lint-typescript:
runs-on: ubuntu-latest
name: TypeScript Lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"
- name: Install dependencies
run: yarn
- name: Run eslint
run: yarn lint --concurrency=3
test-typescript:
runs-on: smithy-typescript_ubuntu-latest_8-core
name: TypeScript Test ${{ matrix.node }}
needs: ['ensure-typescript-packages-have-changesets', 'lint-typescript', 'ensure-typescript-formatted']
strategy:
fail-fast: false
matrix:
node: [16, 18, 20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
- name: Install dependencies
run: yarn
- name: Build packages
run: yarn build
- name: Run unit tests
run: yarn test
- name: Run integration tests
run: |
yarn config set enableImmutableInstalls false
yarn test:integration
ensure-typescript-formatted:
runs-on: ubuntu-latest
name: Ensure TypeScript is formatted
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"
- name: Install dependencies
run: yarn
- name: Run the code formatter
run: yarn format
# This checks the output of git diff. If it's not empty (i.e there were
# changes) it'll return a non-zero error code.
- name: Ensure there are no changes from running the formatter
run: |
git diff
test -z "$(git diff)"
ensure-typescript-packages-have-changesets:
runs-on: ubuntu-latest
name: Ensure TypeScript packages have changesets
steps:
- uses: actions/checkout@v4
# Include full git history needed for `yarn changeset status`
with:
ref: ${{github.event.pull_request.head.sha}}
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"
- name: Install
run: yarn
- name: Ensure changesets exist for each changed package
run: yarn changeset status --since=origin/main