-
Notifications
You must be signed in to change notification settings - Fork 1.5k
137 lines (127 loc) · 5.44 KB
/
native-build-development.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
---
name: "Native Tests - Development"
# Adding the dispatch event to allow restarting the build on demand
on:
schedule:
- cron: '0 2 * * *'
repository_dispatch:
workflow_dispatch:
jobs:
generate-json-matrix:
name: Native Tests - Read JSON matrix
runs-on: ubuntu-latest
if: "github.repository == 'quarkusio/quarkus-quickstarts' || github.event_name == 'workflow_dispatch'"
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.ref || 'development' }}
- id: generate
run: |
json=$(.github/generate-native-matrix.sh | tr -d '\n')
echo "::set-output name=matrix::${json}"
build-with-native:
name: ${{matrix.category}}
runs-on: ubuntu-latest
needs: [generate-json-matrix]
if: "github.repository == 'quarkusio/quarkus-quickstarts' || github.event_name == 'workflow_dispatch'"
strategy:
max-parallel: 5
fail-fast: false
matrix: ${{ fromJson(needs.generate-json-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.ref || 'development' }}
- name: Reclaim Disk Space
run: .github/ci-prerequisites.sh
- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
# refresh cache every month to avoid unlimited growth
key: q2maven-native-${{ steps.get-date.outputs.date }}
- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Build Quarkus main
run: |
git clone https://github.com/quarkusio/quarkus.git
cd quarkus
./mvnw -T1C -e -B --settings .github/mvn-settings.xml clean install -Dquickly-ci
- name: Build Quickstarts with Native
run: |
./mvnw -e -B --settings .github/mvn-settings.xml clean install --fail-at-end -Dnative -Dstart-containers \
-Dquarkus.native.container-build=true -am -pl "${{ matrix.test-modules }}"
#- name: Check RSS
# env:
# QUICKSTART_VERSION: "1.0.0-SNAPSHOT"
# RSS_THRESHOLD: "40000"
# START_TIME_THRESHOLD: "1000"
# REMOTE_OBJECT_NAME: "pmap.out"
# BUCKET_NAME: ${{ secrets.IBM_COS_BUCKET_NAME }}
# API_KEY: ${{ secrets.IBM_COS_SERVICE_CREDENTIAL_API_KEY }}
# SERVICE_INSTANCE_ID: ${{ secrets.IBM_COS_SERVICE_CREDENTIAL_RESOURCE_INSTANCE_ID }}
#
# run: |
# sudo apt-get update -o Dir::Etc::sourcelist="sources.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
# sudo apt-get install -y gnupg2 gnupg-agent
# echo Installing SDKMAN
# curl -s "https://get.sdkman.io" | bash
# source ~/.sdkman/bin/sdkman-init.sh
# sdk install jbang
# getting-started/target/getting-started-${QUICKSTART_VERSION}-runner -Xmx2m -Dquarkus.http.io-threads=1 -Dquarkus.vertx.worker-pool-size=1 > server.log &
# sleep 2
# appPid=$!
# pmap -x $appPid > pmap.out
# ps --no-headers -C getting-started-${QUICKSTART_VERSION}-runner -o rss > rss.out
# rss=$(< rss.out)
# echo "Max RSS Threshold (kB): ${RSS_THRESHOLD}"
# echo "RSS (kB): $rss"
# startTime=$(grep -oP "started in \K([0-9]*\.[0-9]*)" server.log)
# startTimeMs=$(echo "$startTime*1000/1" | bc)
# echo "Start time Threshold (ms): ${START_TIME_THRESHOLD}"
# echo "Start time (ms): $startTimeMs"
# jbang .github/RssRegression.java ${BUCKET_NAME} ${API_KEY} ${SERVICE_INSTANCE_ID} ${REMOTE_OBJECT_NAME} pmap.old.out pmap.out
# [ "$rss" -lt "${RSS_THRESHOLD}" ] && [ "$startTimeMs" -lt "${START_TIME_THRESHOLD}" ] && exit 0 || exit 1
#
#- uses: actions/upload-artifact@v1
# with:
# name: pmap
# path: pmap.out
- name: Delete Local Artifacts From Cache
shell: bash
run: rm -rf ~/.m2/repository/org/acme
report:
name: Report
runs-on: ubuntu-latest
needs: [build-with-native]
if: "always() && github.repository == 'quarkusio/quarkus-quickstarts'"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.ref || 'development' }}
- name: Report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_API_TOKEN }}
STATUS: ${{ needs.build-with-native.result }}
run: |
echo "The report step got status: ${STATUS}"
sudo apt-get update -o Dir::Etc::sourcelist="sources.list" \
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
sudo apt-get install -y gnupg2 gnupg-agent
echo Installing SDKMAN
curl -s "https://get.sdkman.io" | bash
source ~/.sdkman/bin/sdkman-init.sh
sed -i -e 's/sdkman_auto_answer=false/sdkman_auto_answer=true/g' ~/.sdkman/etc/config
sdk install jbang 0.50.1
jbang .github/NativeBuildReport.java token="${GITHUB_TOKEN}" status="${STATUS}" issueRepo="quarkusio/quarkus" issueNumber="6588" thisRepo="${GITHUB_REPOSITORY}" runId="${GITHUB_RUN_ID}"