-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (165 loc) · 5.43 KB
/
push.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
on: push
name: Push
env:
NX_BRANCH: ${{ github.ref_name }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_RUN_GROUP: ${{ github.run_id }}-${{ github.run_attempt }}
SAM_CLI_TELEMETRY: 0
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: './.github/actions/setup'
diff:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: './.github/actions/setup'
- run: ./scripts/diff-lint
lint:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: './.github/actions/setup'
- run: npx nx workspace-lint
- run: npx nx format:check
- run: npm run lint
env:
ESLINT_FORMAT_OPTIONS: |
--format json-with-metadata --output-file reports/style/eslint.json
TSC_OPTIONS: '| tee reports/style/tsc.log'
- uses: check-run-reporter/[email protected]
if: ${{ always() }}
with:
token: ${{ secrets.CHECK_RUN_REPORTER_TOKEN }}
label: ESLint
report: 'reports/style/eslint.json'
- uses: check-run-reporter/[email protected]
if: ${{ always() }}
with:
token: ${{ secrets.CHECK_RUN_REPORTER_TOKEN }}
label: TSC
report: 'reports/style/tsc.log'
release:
needs:
- build
- diff
- lint
- test-integration
- test-unit
runs-on: ubuntu-latest
# This job gets exponentially slower based on the number of packages that
# need to be release, so 60 is not unreasonable.
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: './.github/actions/setup'
- run: |
npm config set workspaces-update false
npx multi-semantic-release \
--deps.release=inherit \
--ignore-private-packages
env:
GIT_AUTHOR_EMAIL:
${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
GIT_COMMITTER_EMAIL:
${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
GIT_AUTHOR_NAME: ${{ github.actor }}
GIT_COMMITTER_NAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
test-integration:
needs: build
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# There should be one node for each example, but at time of writing,
# two of the examples are disabled due to issues with localstack.
nodeCount: [5]
nodeIndex: [0, 1, 2, 3, 4]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure AWS credentials from Test account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
- uses: './.github/actions/setup'
- uses: check-run-reporter/[email protected]
id: split
with:
token: ${{ secrets.CHECK_RUN_REPORTER_TOKEN }}
label: Unit Tests
nodeCount: ${{ matrix.nodeCount }}
nodeIndex: ${{ matrix.nodeIndex }}
tests: 'examples/**/*.test.ts'
# Deploy all the stacks. Assuming we tuned the matrix correctly, this
# _should_ be one stack per job, but we treat it as a list just in case.
- run: |
PATH=$PATH:$(pwd)/node_modules/.bin ./scripts/crr-sam deploy ${{ steps.split.outputs.tests }}
id: deploy
- run: npm test -- ${{ steps.split.outputs.tests }}
env:
# We set RETAIN=true so that the cleanup script can take remove the
# stack rather than doing it inside the jest lifecycle.
RETAIN: true
TEST_ENV: aws
# The script keeps track of each stack it deployed so we only attempt to
# cleanup stacks that actually exist.
- run: ./scripts/crr-sam destroy ${{ steps.deploy.outputs.deployed }}
if: ${{ always() }}
- uses: check-run-reporter/[email protected]
if: ${{ always() }}
with:
token: ${{ secrets.CHECK_RUN_REPORTER_TOKEN }}
label: Examples
nodeCount: ${{ matrix.nodeCount }}
nodeIndex: ${{ matrix.nodeIndex }}
report: 'reports/junit/**/*.xml'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: 'reports/coverage'
test-unit:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: './.github/actions/setup'
- run: npm test -- --selectProjects 'Unit Tests'
- uses: check-run-reporter/[email protected]
if: ${{ always() }}
with:
token: ${{ secrets.CHECK_RUN_REPORTER_TOKEN }}
label: Unit Tests
report: 'reports/junit/**/*.xml'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: 'reports/coverage'