Skip to content

Merge pull request #156 from zakkak/2023-05-09-refactor-tests #503

Merge pull request #156 from zakkak/2023-05-09-refactor-tests

Merge pull request #156 from zakkak/2023-05-09-refactor-tests #503

name: Testing testsuite
on:
workflow_dispatch:
push:
paths-ignore:
- 'LICENSE'
- '**.md'
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
paths-ignore:
- 'LICENSE'
- '**.md'
env:
LANG: en_US.UTF-8
jobs:
local-run:
name: ${{ matrix.os }} - ${{ matrix.java-version }} - ${{ matrix.mandrel-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
mandrel-version: [ '22.3.4.0-Final', '23.0.2.1-Final' ]
java-version: [ '17' ]
os: [ ubuntu-20.04, windows-2019 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
path: ts
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ matrix.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ matrix.os }}-
- uses: actions/cache@v3
name: Mandrel installation cached
id: cache_mandrel
with:
path: |
${{ github.workspace }}/${{ matrix.java-version }}-${{ matrix.mandrel-version }}
key: ${{ matrix.os }}-${{ matrix.java-version }}-${{ matrix.mandrel-version }}
- name: Install Mandrel Windows
if: startsWith(matrix.os, 'windows') && steps.cache_mandrel.outputs.cache-hit != 'true'
run: |
$url= "https://github.com/graalvm/mandrel/releases/download/mandrel-${{ matrix.mandrel-version }}/mandrel-java${{ matrix.java-version }}-windows-amd64-${{ matrix.mandrel-version }}.zip"
$wc = New-Object System.Net.WebClient
$file = $(Split-Path -Path $url -Leaf)
Write-Host "Downloading $url to $Env:temp\$file"
$wc.DownloadFile($url, "$Env:temp\$file")
Expand-Archive "$Env:temp\$file" -DestinationPath "${{ github.workspace }}"
$path=(Get-ChildItem mandrel-*).name
move $path ${{ github.workspace }}/${{ matrix.java-version }}-${{ matrix.mandrel-version }}
shell: powershell
- name: Install Mandrel Linux
if: startsWith(matrix.os, 'ubuntu') && steps.cache_mandrel.outputs.cache-hit != 'true'
run: |
wget "https://github.com/graalvm/mandrel/releases/download/mandrel-${{ matrix.mandrel-version }}/mandrel-java${{ matrix.java-version }}-linux-amd64-${{ matrix.mandrel-version }}.tar.gz"
tar -xf mandrel-java${{ matrix.java-version }}-linux-amd64-${{ matrix.mandrel-version }}.tar.gz
rm *.tar.gz
mv $( echo mandrel-java${{ matrix.java-version }}*-*/ ) ${{ github.workspace }}/${{ matrix.java-version }}-${{ matrix.mandrel-version }}
shell: bash
- name: Windows test
if: startsWith(matrix.os, 'windows')
timeout-minutes: 55
env:
MAVEN_OPTS: -Xmx1g
run: |
set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\;%PATH%
call vcvars64
IF NOT %ERRORLEVEL% == 0 ( exit 1 )
set "GRAALVM_HOME=${{ github.workspace }}\${{ matrix.java-version }}-${{ matrix.mandrel-version }}"
set "JAVA_HOME=%GRAALVM_HOME%"
set "PATH=%JAVA_HOME%\bin;%PATH%"
if not exist "%GRAALVM_HOME%\bin\native-image.cmd" (
echo "Cannot find native-image tool. Quitting..."
exit 1
) else (
echo "native-image.cmd is present, good."
cmd /C native-image --version
)
pushd ts
mkdir ~/.m2/
copy .github/mvn-settings.xml ~/.m2/settings.xml
mvn clean verify -Ptestsuite -DexcludeTags=all -DincludeTags=testing-testsuite
shell: cmd
- name: Linux test
if: startsWith(matrix.os, 'ubuntu')
timeout-minutes: 55
env:
MAVEN_OPTS: -Xmx1g
run: |
sudo apt-get update -y
sudo apt-get install -y gdb
export JAVA_HOME=${{ github.workspace }}/${{ matrix.java-version }}-${{ matrix.mandrel-version }}
export GRAALVM_HOME="${JAVA_HOME}"
export PATH="${JAVA_HOME}/bin:$PATH"
if [[ ! -e "${JAVA_HOME}/bin/native-image" ]]; then
echo "Cannot find native-image tool. Quitting..."
exit 1
fi
native-image --version
pushd ts
mkdir -p ~/.m2/
cp .github/mvn-settings.xml ~/.m2/settings.xml
mvn clean verify -Ptestsuite -DexcludeTags=all -DincludeTags=testing-testsuite
shell: bash
- name: Prepare failure archive (if maven failed)
if: failure()
run: tar czvf test-reports-mandrel-it.tgz ${{ github.workspace }}/ts/testsuite/target/archived-logs
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v3
if: failure()
with:
name: reports-${{ matrix.mandrel-version }}-${{ matrix.java-version }}-${{ matrix.os }}
path: 'test-reports-mandrel-it.tgz'