-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (59 loc) · 2.47 KB
/
Copy pathtest-and-release.yaml
File metadata and controls
72 lines (59 loc) · 2.47 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
name: Test and Release
on: push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STACK_BASE_NAME: bddawsx-${{ github.sha }}
NODE_NO_WARNINGS: 1
permissions:
id-token: write
contents: write
issues: write
actions: write
jobs:
tests:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ">=24.19.0 <25"
cache: "npm"
- name: Install NPM version specified in package.json
uses: ./.github/actions/install-npm
- name: Install dependencies
run: npm ci --no-audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@cbe3b392738ccf3f987d68400dafcf4b0624a56c # v6.2.4
with:
# The role is set up via https://github.com/bifravst/ci
# secrets.AWS_ACCOUNT_ID_CI is an organization secret
role-to-assume: |
arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID_CI }}:role/${{ github.repository_owner }}-ci-${{ github.event.repository.name }}
# vars.AWS_REGION_CI is an organization variable
aws-region: ${{ vars.AWS_REGION_CI }}
- name: Set up test resources
run: npx cdk deploy --require-approval never
- name: Test
run: |
node --experimental-transform-types --no-warnings features/run-features.ts > e2e-test-result.json
cat e2e-test-result.json | node --experimental-transform-types --no-warnings features/console-reporter.ts
cat e2e-test-result.json | node --experimental-transform-types --no-warnings features/markdown-reporter.ts >> $GITHUB_STEP_SUMMARY
cat e2e-test-result.json | node --experimental-transform-types --no-warnings features/traceToMermaid.ts >> $GITHUB_STEP_SUMMARY
- name: Print failed End-to-End tests
if: failure()
run:
cat e2e-test-result.json | node --experimental-transform-types
--no-warnings features/console-reporter.ts
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: failure()
with:
name: e2e-test-result
path: e2e-test-result.json
- name: Semantic release
if: success()
run: |
npm i --no-save semantic-release@next
npx semantic-release
- name: Clean up End-to-End test resources
if: always()
run: npx cdk destroy -f