chore: Quarkus autoupdate action runs somke test (#1723)

Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
Matej Vasek 2023-05-04 22:23:56 +02:00 committed by GitHub
parent dc3a85112c
commit c715dabcd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -17,6 +17,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/setup-java@v1
with:
java-version: 17
- name: Install NPM deps.
run: npm install axios xml2js octokit
- name: Create PR

View File

@ -84,6 +84,19 @@ const updatePlatformInPom = async (pomPath, newPlatform) => {
await writeFile(pomPath, newPomData)
}
const smokeTest = () => {
const subproc = spawn("make", ["test-quarkus"], {stdio: ['inherit', 'inherit', 'inherit']})
return new Promise((resolve, reject) => {
subproc.on('exit', code => {
if (code === 0) {
resolve()
return
}
reject(new Error("smoke test failed: non-zero exit code"))
})
})
}
const main = async () => {
const latestPlatform = await getLatestPlatform()
const prTitle = `chore: update Quarkus platform version to ${latestPlatform}`
@ -103,6 +116,7 @@ const main = async () => {
await updatePlatformInPom(cePomPath, latestPlatform)
await updatePlatformInPom(httpPomPath, latestPlatform)
await smokeTest()
await prepareBranch(branchName, prTitle)
await octokit.rest.pulls.create({
owner: owner,