Try again #3
Workflow file for this run
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: Gradle test | ||
on: | ||
workflow_call: | ||
secrets: | ||
ROSIE_PERSONAL_ACCESS_TOKEN: | ||
description: 'Personal access token' | ||
required: false | ||
inputs: | ||
extra-repos: | ||
required: false | ||
type: string | ||
description: 'JSON array of repositories to checkout, repos are required to be in the ihmcrobotics org. Do not include ihmcrobotics in the name.' | ||
default: '[""]' | ||
subproject: | ||
required: false | ||
type: string | ||
description: 'Sub project name' | ||
test-category: | ||
required: false | ||
type: string | ||
description: 'Test category' | ||
default: 'fast' | ||
requires-self-hosted: | ||
required: false | ||
type: boolean | ||
description: 'Set to true to use a self-hosted runner, false for ubuntu-latest' | ||
default: false | ||
timeout-minutes: | ||
required: false | ||
type: number | ||
description: 'Number of minutes before the build job times out (default 30)' | ||
default: 30 | ||
jobs: | ||
build: | ||
timeout-minutes: ${{ inputs.timeout-minutes }} | ||
runs-on: ${{ inputs.requires-self-hosted && 'self-hosted' || 'ubuntu-latest' }} | ||
container: | ||
image: ${{ inputs.requires-self-hosted && 'ihmcrobotics/ihmc-runner-nvidia:1.0.1' || 'ihmcrobotics/ihmc-runner:1.0.0' }} | ||
options: ${{ inputs.requires-self-hosted && '--runtime=nvidia --gpus all --cpus 4' || '--cpus 4' }} | ||
steps: | ||
# Checkout repository-group | ||
- name: Checkout repository-group | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ihmcrobotics/repository-group | ||
ref: develop | ||
path: repository-group | ||
lfs: false | ||
# Checkout current repo | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: repository-group/${{ github.event.repository.name }} | ||
lfs: false | ||
- name: Checkout extra repos | ||
env: | ||
REPOS: ${{ inputs.extra-repos }} | ||
CURRENT_REF: ${{ github.head_ref }} | ||
REF: ${{ github.ref }} | ||
SHA: ${{ github.sha }} | ||
ROSIE_PERSONAL_ACCESS_TOKEN: ${{ secrets.ROSIE_PERSONAL_ACCESS_TOKEN }} | ||
run: | | ||
# Checkout integrated dependency repositories | ||
echo "Parsing JSON repository list" | ||
REPO_LIST=$(echo "$REPOS" | jq -r '.[]') | ||
echo "Checking out $REPO_LIST using minimal resources" | ||
for repo in $REPO_LIST; do | ||
if [ -z "$CURRENT_REF" ]; then | ||
if [ -n "$ROSIE_PERSONAL_ACCESS_TOKEN" ]; then | ||
echo "::command::git -c protocol.version=2 clone --depth 1 https://"$ROSIE_PERSONAL_ACCESS_TOKEN"@github.com/ihmcrobotics/$repo.git" | ||
git -c protocol.version=2 clone --depth 1 https://"$ROSIE_PERSONAL_ACCESS_TOKEN"@github.com/ihmcrobotics/$repo.git | ||
else | ||
echo "::command::git -c protocol.version=2 clone --depth 1 https://@github.com/ihmcrobotics/$repo.git" | ||
git -c protocol.version=2 clone --depth 1 https://@github.com/ihmcrobotics/$repo.git | ||
fi | ||
else | ||
# echo "::group::Initializing repository-group/$repo" | ||
# echo "::command::git init repository-group/$repo" | ||
# git init repository-group/$repo | ||
# echo "::endgroup::" | ||
# cd repository-group/$repo | ||
# | ||
# echo "Disabling automatic garbage collection" | ||
# git config --local gc.auto 0 | ||
echo "Adding remote for $repo" | ||
if [ -n "$ROSIE_PERSONAL_ACCESS_TOKEN" ]; then | ||
echo "Using ihmc-rosie personal access token" | ||
echo "[command]git -c protocol.version=2 clone --depth 1 --progress --force --single-branch --branch $CURRENT_REF https://"$ROSIE_PERSONAL_ACCESS_TOKEN"@github.com/ihmcrobotics/$repo.git repository-group/$repo" | ||
git -c protocol.version=2 clone --depth 1 --progress --force --single-branch --branch $CURRENT_REF https://"$ROSIE_PERSONAL_ACCESS_TOKEN"@github.com/ihmcrobotics/$repo.git repository-group/$repo | ||
else | ||
git remote add origin https://github.com/ihmcrobotics/$repo.git repository-group/$repo | ||
fi | ||
# echo "git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth 1 origin $REF" | ||
# git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth 1 origin $REF | ||
# echo "git checkout --progress --force FETCH_HEAD" | ||
# git checkout --progress --force FETCH_HEAD | ||
fi | ||
cd ../../ | ||
done | ||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
gradle-version: "8.11.1" | ||
- name: Gradle test | ||
env: | ||
SUBPROJECT: ${{ inputs.subproject }} | ||
CURRENT_REPO: ${{ github.event.repository.name }} | ||
TEST_CATEGORY: ${{ inputs.test-category }} | ||
run: | | ||
if [ -n "$SUBPROJECT" ]; then | ||
echo "Using subproject: $SUBPROJECT" | ||
cd repository-group/$CURRENT_REPO/$SUBPROJECT | ||
else | ||
cd repository-group/$CURRENT_REPO | ||
fi | ||
git lfs install --local | ||
git lfs fetch | ||
git lfs pull | ||
gradle test -Pcategory=$TEST_CATEGORY --no-daemon -PrunningOnCIServer=true -Dorg.gradle.jvmargs="-Xmx4G" | ||
- name: Publish Test Report - ${{ inputs.test-category }} | ||
uses: mikepenz/action-junit-report@v4 | ||
if: success() || failure() # always run even if the previous step fails | ||
with: | ||
report_paths: '**/build/test-results/test/TEST-*.xml' | ||
detailed_summary: true | ||
check_name: JUnit Test Report ${{ inputs.subproject || ''}} | ||
- name: Send JUNIT XML Files to Evergreen API | ||
uses: ihmcrobotics/ihmc-actions/.github/actions/send-junit-to-api@main | ||
if: success() || failure() # always run even if the previous step fails | ||
with: | ||
subproject: ${{ inputs.subproject }} |