Skip to content

ihmcrobotics/ihmc-actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

105 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IHMC Actions

This repository contains reusable actions and workflows for ihmcrobotics repositories.

Workflows

gradle-test

gradle-test is meant to run JUnit tests within a Gradle (Java/Kotlin/Groovy) project.

Inputs

Input name Required Description Example input
extra-repos false A JSON array of extra repositories to clone '["my-extra-repo-1", "my-extra-repo-2"]'
subproject false The subproject to test, if using a multi-project repo "my-subproject"
test-category false The JUnit Tag / Category to run (default to "fast") "my-tag"
requires-self-hosted false Whether or not to run the job on a self-hosted runner or GitHub-hosted runners true
timeout-minutes false Number of minutes before the build job times out (default 30) 45

Example usage

name: Gradle test

on:
  workflow_dispatch:
  push:
    branches:
      - develop
  pull_request:

jobs:
  gradle-test:
    uses: ihmcrobotics/ihmc-actions/.github/workflows/gradle-test.yml@main

trigger-dependents

On push to a source repo's develop branch, dispatches workflows in direct dependents listed in the org secret DEPENDENCY_GRAPH. Source repos add a thin caller workflow and pass ROSIE_PERSONAL_ACCESS_TOKEN and DEPENDENCY_GRAPH; consumers need only existing workflow_dispatch. Which workflow file is dispatched is configured entirely in the org secret.

Skips dispatch when the dependent's develop moved at or after the source update (co-merge case), or when that workflow already has a run on the current develop HEAD since then. A recent run on an older commit does not block dispatch.

Graph format (JSON string in org secret): "source-repo": [["dependent-repo", "workflow-file.yml"], ...]. Branch is always develop. Org admins maintain the secret and grant access to repos with a trigger caller workflow.

Actions

send-junit-to-api

action sends junit xml files to evergreen api

Example ussage

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

jobs:
  build:
    runs-on: 'self-hosted'   
    steps:
      # Checkout repository-group
      - name: Checkout repository-group
        uses: actions/checkout@v4        

      ....

      - 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.10.2"

      - name: Gradle test        
        run: 
          gradle test"

      ## generate XML files
      - 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 || ''}}

About

Reusable GitHub actions & workflows for ihmcrobotics projects

Resources

License

Stars

Watchers

Forks

Contributors