-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (92 loc) · 2.86 KB
/
ci.yaml
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
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
essential-checks:
runs-on: ubuntu-22.04
steps:
- name: Project Checkout
uses: actions/[email protected]
- name: Run essential checks
uses: dotanuki-labs/github-actions/essentials@main
with:
file-patterns: '*.sh,*.bats,*.kt,*.kts'
license: 'mit'
build:
runs-on: ubuntu-22.04
needs: essential-checks
strategy:
matrix:
jdk: [ '11', '17', '21' ]
steps:
- name: Project Checkout
uses: actions/[email protected]
- name: Setup JDK
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- name: Setup Gradle build
uses: gradle/[email protected]
with:
generate-job-summary: false
gradle-home-cache-strict-match: false
gradle-home-cache-cleanup: true
dependency-graph: 'generate-and-submit'
- name: Run Gradle build
id: build
run: ./gradlew build assembleExecutable --scan
- name: Report Build Scan
if: ${{ github.event_name == 'pull_request' }}
run: ./scripts/build-scan-report.sh ${{ github.event.pull_request.number }} ${{ steps.build.outputs.build-scan-url }}
env:
GH_TOKEN: ${{ secrets.DOTANUKI_BOT_TOKEN }}
- name: Run acceptance tests
run: |
npm install -g bats >/dev/null
bats src/test/bash/acceptance.bats --print-output-on-failure
- name: Archive executable
uses: actions/[email protected]
with:
name: aaw-executable-jdk-${{ matrix.jdk }}
path: build/bin
e2e:
runs-on: ubuntu-22.04
needs: build
steps:
- name: Project Checkout
uses: actions/[email protected]
- name: Setup JDK
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: '11'
- name: Fetch executable from previous build
uses: actions/[email protected]
- name: Add binary to the CLI path
run: |
chmod +x aaw-executable-jdk-11/aaw
echo "$GITHUB_WORKSPACE/aaw-executable-jdk-11" >> "$GITHUB_PATH"
- name: Run E2E tests
run: |
npm install -g bats
bats src/test/bash/e2e.bats --print-output-on-failure
secops:
if: github.ref == 'refs/heads/main'
permissions:
security-events: read
runs-on: ubuntu-22.04
needs: build
steps:
- name: Project Checkout
uses: actions/[email protected]
- name: Evaluate CVEs for the current Git sha
run: ./scripts/secops.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.sha }}
- name: Archive SBOM
uses: actions/[email protected]
with:
name: sbom
path: aaw-sbom-${{ github.sha }}.json