-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (99 loc) · 3.55 KB
/
ci.yml
File metadata and controls
117 lines (99 loc) · 3.55 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
checks: write
id-token: write
jobs:
build-and-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up SAM CLI
uses: aws-actions/setup-sam@v2
- name: Build layer (amd64)
run: make build-amd64
- name: Run ShellSpec (smoke)
id: shellspec_smoke
continue-on-error: true
run: SHELLSPEC_ARGS='--output junit --shell /bin/sh --reportdir report/smoke' make test-smoke
- name: Run ShellSpec (unit)
id: shellspec_unit
continue-on-error: true
run: SHELLSPEC_ARGS='--output junit --shell /bin/sh --reportdir report/unit' make test-unit
- name: Run ShellSpec (integration)
id: shellspec_integration
continue-on-error: true
run: SHELLSPEC_ARGS='--output junit --shell /bin/sh --reportdir report/integration' make test-int
- name: Upload smoke test report
if: always()
uses: actions/upload-artifact@v4
with:
name: shellspec-smoke-junit
path: report/smoke/results_junit.xml
if-no-files-found: warn
- name: Upload unit test report
if: always()
uses: actions/upload-artifact@v4
with:
name: shellspec-unit-junit
path: report/unit/results_junit.xml
if-no-files-found: warn
- name: Upload integration test report
if: always()
uses: actions/upload-artifact@v4
with:
name: shellspec-integration-junit
path: report/integration/results_junit.xml
if-no-files-found: warn
- name: Publish smoke test report
if: always()
uses: dorny/test-reporter@v1
with:
name: shellspec-smoke
path: report/smoke/results_junit.xml
reporter: java-junit
fail-on-error: false
- name: Publish unit test report
if: always()
uses: dorny/test-reporter@v1
with:
name: shellspec-unit
path: report/unit/results_junit.xml
reporter: java-junit
fail-on-error: false
- name: Publish integration test report
if: always()
uses: dorny/test-reporter@v1
with:
name: shellspec-integration
path: report/integration/results_junit.xml
reporter: java-junit
fail-on-error: false
- name: Fail if tests failed
if: steps.shellspec_smoke.outcome != 'success' || steps.shellspec_unit.outcome != 'success' || steps.shellspec_integration.outcome != 'success'
run: exit 1
- name: Configure AWS credentials (OIDC)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
- name: Log AWS caller identity
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: aws sts get-caller-identity
- name: Publish and deploy dev SAR (amd64)
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && steps.shellspec_smoke.outcome == 'success' && steps.shellspec_unit.outcome == 'success' && steps.shellspec_integration.outcome == 'success'
env:
ENV: dev
run: |
make delete-sar ARCH=amd64
make publish-sar ARCH=amd64
make deploy-sar ARCH=amd64