Native Tests - Development #2862
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 "matrix=${json}" >> $GITHUB_OUTPUT | |
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' | |
outputs: | |
quarkus-sha: ${{ steps.build-quarkus.outputs.sha }} | |
project-sha: ${{ steps.project-sha.outputs.sha }} | |
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: Get current SHA | |
id: project-sha | |
run: | | |
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: Reclaim Disk Space | |
run: .github/ci-prerequisites.sh | |
- name: Get Date | |
id: get-date | |
run: | | |
echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT | |
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 | |
id: build-quarkus | |
run: | | |
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
git clone https://github.com/quarkusio/quarkus.git | |
cd quarkus | |
./mvnw -T1C -e -B --settings .github/mvn-settings.xml clean install -Dquickly-ci -Prelocations | |
- 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' }} | |
- uses: quarkusio/report-status-in-issue@main | |
with: | |
github-token: ${{ secrets.GITHUB_API_TOKEN }} | |
status: ${{ needs.build-with-native.result }} | |
issue-repository: quarkusio/quarkus | |
issue-number: 6588 | |
quarkus-sha: ${{ needs.build-with-native.outputs.quarkus-sha }} | |
project-sha: ${{ needs.build-with-native.outputs.project-sha }} |