Add maven functional testing in github actions #781
This file contains 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: "Test native-gradle-plugin" | |
on: | |
push: | |
paths: | |
- 'native-gradle-plugin/**' | |
- 'samples/**' | |
- 'common/**' | |
- '.github/actions/**' | |
- '.github/workflows/test-native-gradle-plugin.yml' | |
- 'gradle/libs.versions.toml' | |
pull_request: | |
paths: | |
- 'native-gradle-plugin/**' | |
- 'samples/**' | |
- 'common/**' | |
- '.github/actions/**' | |
- '.github/workflows/test-native-gradle-plugin.yml' | |
- 'gradle/libs.versions.toml' | |
workflow_dispatch: | |
concurrency: | |
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" | |
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'graalvm/native-build-tools' }} | |
jobs: | |
populate-matrix: | |
name: "Set matrix" | |
runs-on: "ubuntu-20.04" | |
timeout-minutes: 5 | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: "βοΈ Checkout repository" | |
uses: actions/checkout@v3 | |
- name: "π§ Prepare environment" | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '17' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "πΈοΈ Populate matrix" | |
id: set-matrix | |
run: ./gradlew -PmatrixType=gradle :native-gradle-plugin:dumpFunctionalTestList | |
functional-testing-gradle-plugin: | |
name: "π§ͺ Gradle: ${{ matrix.test }} on ${{ matrix.os }} with gradle version: ${{ matrix.gradle-version }}" | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
needs: populate-matrix | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.populate-matrix.outputs.matrix)}} | |
steps: | |
- name: "βοΈ Checkout repository" | |
uses: actions/checkout@v4 | |
- name: "π§ Prepare environment" | |
uses: ./.github/actions/prepare-environment | |
with: | |
java-version: ${{ matrix.java-version }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "β Check and test the plugin" | |
run: ./gradlew :native-gradle-plugin:functionalTest -DgradleVersion="${{ matrix.gradle-version }}" --tests ${{ matrix.test }} | |
- name: "π Upload functional tests results" | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: functional-tests-results-${{ matrix.gradle-version }} | |
path: native-gradle-plugin/build/reports/tests/functionalTest/ | |
populate-cache-matrix: | |
name: "Set cache matrix" | |
runs-on: "ubuntu-20.04" | |
timeout-minutes: 5 | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: "βοΈ Checkout repository" | |
uses: actions/checkout@v3 | |
- name: "π§ Prepare environment" | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '17' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "πΈοΈ Populate matrix" | |
id: set-matrix | |
run: | | |
./gradlew -PmatrixType=gradleCached :native-gradle-plugin:dumpFunctionalTestList | |
functional-testing-gradle-with-cache-version: | |
name: "π§ͺ Gradle: ${{ matrix.test }} on ${{ matrix.os }} with cache gradle version: ${{ matrix.gradle-config-cache-version }}" | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
needs: populate-cache-matrix | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.populate-cache-matrix.outputs.matrix)}} | |
steps: | |
- name: "βοΈ Checkout repository" | |
uses: actions/checkout@v4 | |
- name: "π§ Prepare environment" | |
uses: ./.github/actions/prepare-environment | |
with: | |
java-version: ${{ matrix.java-version }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "β Check and test the plugin with configuration cache" | |
run: ./gradlew :native-gradle-plugin:configCacheFunctionalTest -DgradleVersion="${{ matrix.gradle-config-cache-version }}" --tests ${{ matrix.test }} | |
- name: "π Upload functional tests results" | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: functional-tests-results-${{ matrix.gradle-config-cache-version }} | |
path: native-gradle-plugin/build/reports/tests/functionalTest/ | |
test-native-gradle-plugin: | |
name: "Sanity checks" | |
runs-on: "ubuntu-20.04" | |
timeout-minutes: 50 | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: [ 17 ] | |
os: [ ubuntu-20.04 ] | |
steps: | |
- name: "βοΈ Checkout repository" | |
uses: actions/checkout@v4 | |
- name: "π§ Prepare environment" | |
uses: ./.github/actions/prepare-environment | |
with: | |
java-version: ${{ matrix.java-version }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "β Unit tests and inspections" | |
run: ./gradlew :native-gradle-plugin:test :native-gradle-plugin:inspections | |
- name: "π Upload unit test results" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unit-tests-results | |
path: native-gradle-plugin/build/reports/tests/test/ | |
functional-testing-gradle-plugin-dev: | |
name: "Functional testing (GraalVM Dev Build)" | |
runs-on: ${{ matrix.os }} | |
env: | |
IS_GRAALVM_DEV_BUILD: 'true' | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: [ 17 ] | |
os: [ ubuntu-20.04 ] | |
steps: | |
- name: "βοΈ Checkout repository" | |
uses: actions/checkout@v4 | |
- name: "π§ Prepare environment" | |
uses: ./.github/actions/prepare-environment | |
with: | |
java-version: ${{ matrix.java-version }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "π§ Install GraalVM (dev)" | |
uses: graalvm/setup-graalvm@main | |
with: | |
java-version: 'dev' | |
distribution: 'graalvm' | |
github-token: ${{ inputs.github-token }} | |
set-java-home: 'false' | |
- name: "β Check and test the plugin" | |
run: ./gradlew :native-gradle-plugin:functionalTest | |
- name: "π Upload functional tests results" | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: functional-tests-results-graalvm-dev | |
path: native-gradle-plugin/build/reports/tests/functionalTest/ |