Skip to content

Commit

Permalink
Move checkout workspace to action
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-5546 committed Dec 5, 2023
1 parent 129604f commit 58232f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
9 changes: 9 additions & 0 deletions .github/actions/checkout/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@ name: 'Checkout Repositories'
description: 'Checkout the repositories depending on the inputs'

inputs:
ref:
description: 'The sailbot workspace ref to checkout'
required: true
repository:
description: 'The repository name: github.event.repository.name'
required: true

runs:
using: "composite"
steps:
- name: Checkout workspace
uses: actions/checkout@v4
with:
repository: UBCSailbot/sailbot_workspace
ref: ${{ needs.extract-metadata.outputs.caller-ref }}

- name: Checkout ROS package
if: ${{ inputs.repository != 'sailbot_workspace' }}
uses: actions/checkout@v4
Expand Down
31 changes: 1 addition & 30 deletions .github/workflows/test_definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,10 @@ jobs:
if: ${{ inputs.ros-ci }}
needs: [extract-metadata]
steps:
- name: Checkout workspace
uses: actions/checkout@v4
with:
repository: UBCSailbot/sailbot_workspace
ref: ${{ needs.extract-metadata.outputs.caller-ref }}

- name: Checkout repositories
uses: ./.github/actions/checkout/
with:
ref: ${{ needs.extract-metadata.outputs.caller-ref }}
repository: ${{ inputs.repository }}

- name: Test
Expand All @@ -93,12 +88,6 @@ jobs:
if: ${{ inputs.ros-ci }}
needs: [extract-metadata]
steps:
- name: Checkout workspace
uses: actions/checkout@v4
with:
repository: UBCSailbot/sailbot_workspace
ref: ${{ needs.extract-metadata.outputs.caller-ref }}

- name: Checkout repositories
uses: ./.github/actions/checkout/
with:
Expand All @@ -116,12 +105,6 @@ jobs:
if: inputs.clang-tidy
needs: [extract-metadata]
steps:
- name: Checkout workspace
uses: actions/checkout@v4
with:
repository: UBCSailbot/sailbot_workspace
ref: ${{ needs.extract-metadata.outputs.caller-ref }}

- name: Checkout repositories
uses: ./.github/actions/checkout/
with:
Expand All @@ -139,12 +122,6 @@ jobs:
if: ${{ inputs.markdown-ci }}
needs: [extract-metadata]
steps:
- name: Checkout workspace
uses: actions/checkout@v4
with:
repository: UBCSailbot/sailbot_workspace
ref: ${{ needs.extract-metadata.outputs.caller-ref }}

- name: Checkout repositories
uses: ./.github/actions/checkout/
with:
Expand Down Expand Up @@ -173,12 +150,6 @@ jobs:
if: ${{ inputs.markdown-ci }}
needs: [extract-metadata]
steps:
- name: Checkout workspace
uses: actions/checkout@v4
with:
repository: UBCSailbot/sailbot_workspace
ref: ${{ needs.extract-metadata.outputs.caller-ref }}

- name: Checkout repositories
uses: ./.github/actions/checkout/
with:
Expand Down

0 comments on commit 58232f2

Please sign in to comment.