Skip to content

Commit

Permalink
chore(actions): add native validation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollovati committed Nov 10, 2024
1 parent 5f9d61f commit 142d646
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/validation-native.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Quarkus Hilla Native Validation
on:
pull_request_target:
types: [opened, synchronize, reopened, edited]
permissions:
contents: read
issues: read
checks: write
pull-requests: write
concurrency:
group: validation-native-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
check-permissions:
name: Check User Permissions
runs-on: ubuntu-latest
steps:
- run: echo "Concurrency Group = ${{ github.head_ref || github.ref_name }}"
- uses: actions-cool/check-user-permission@main
id: checkUser
with:
username: ${{github.triggering_actor}}
require: 'write'
- name: Fail on workflow triggered by external contributor
if: ${{ steps.checkUser.outputs.require-result != 'true' && github.actor != 'dependabot[bot]' && github.actor != 'quarkus-hilla-bot[bot]' }}
run: |
echo "🚫 **${{ github.actor }}** is an external contributor, a **${{ github.repository }}** team member has to review this changes and re-run this build" \
| tee -a $GITHUB_STEP_SUMMARY && exit 1
changes:
name: Compute changes
needs: [check-permissions]
runs-on: ubuntu-latest
outputs:
validation-required: ${{ steps.filter.outputs.validate }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
validate:
- '!(README.md|LICENSE|.gitignore|etc/**)'
build-and-test-native:
name: Native tests
needs: [changes]
if: ${{ needs.changes.outputs.validation-required == 'true' }}
timeout-minutes: 90
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 23
distribution: 'graalvm'
cache: maven
- uses: browser-actions/setup-chrome@latest
id: setup-chrome
if: ${{ !vars.QH_DISABLE_CHROME_INSTALL }}
with:
chrome-version: stable
- name: Build
run: |
set -x -e -o pipefail
mvn -V -e -B -ntp -DskipTests -Dmaven.javadoc.skip=false install
- name: Native Test
run: |
set -x -e -o pipefail
mvn -V -e -B -ntp verify -Dmaven.javadoc.skip=false -DtrimStackTrace=false -Dselenide.browserBinary=${{ steps.setup-chrome.outputs.chrome-path }} -Pit-tests,production -Dnative
- name: Package test output files
if: ${{ failure() || success() }}
run: find . -name surefire-reports -o -name failsafe-reports -o -name selenide-reports -o -name quarkus.log | tar -czf tests-report-native.tgz -T -
- uses: actions/upload-artifact@v4
if: ${{ failure() || success() }}
with:
name: tests-output-it-native
path: tests-report-*.tgz
20 changes: 20 additions & 0 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,26 @@
<skipITs>false</skipITs>
<quarkus.package.type>native</quarkus.package.type>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/*NativeIT.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!--
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2024 Marco Collovati, Dario Götze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.application;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class AutoGridNativeIT extends AutoGridTest {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2024 Marco Collovati, Dario Götze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.application;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class SignalsNativeIT extends SignalsTest {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2024 Marco Collovati, Dario Götze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.application;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
class SmokeNativeIT extends SmokeTest {}

0 comments on commit 142d646

Please sign in to comment.