Skip to content

Commit

Permalink
add composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
pzhu-flexiv committed Nov 26, 2024
1 parent 86fc594 commit 98c7d41
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 36 deletions.
46 changes: 10 additions & 36 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,31 @@ jobs:
build-ubuntu-22:
# GitHub-hosted Ubuntu 22.04 runner
runs-on: ubuntu-22.04
# The steps are the same across all jobs
steps: &shared-steps
- uses: actions/checkout@v2
# Build and install all dependencies to RDK installation directory.
- name: Build and install dependencies
run: |
cd ${{github.workspace}}
cd thirdparty
bash build_and_install_dependencies.sh ~/rdk_install 4
# Configure CMake, then build and install flexiv_rdk library to RDK installation directory.
- name: Build and install library
run: |
cd ${{github.workspace}}
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
make install
# Find and link to flexiv_rdk library, then build all example programs.
- name: Build examples
run: |
cd ${{github.workspace}}/example
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
make -j4
# Find and link to flexiv_rdk library, then build all test programs.
- name: Build tests
run: |
cd ${{github.workspace}}/test
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
make -j4
# Use shared steps
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/shared_steps

build-ubuntu-20:
# GitHub-hosted Ubuntu 20.04 runner
runs-on: ubuntu-20.04
# Use shared steps
steps:
- *shared-steps
- uses: actions/checkout@v3
- uses: ./.github/workflows/shared_steps

build-macos-12:
# GitHub-hosted macOS 14 runner with M1 chip
runs-on: macos-14
# Use shared steps
steps:
- *shared-steps
- uses: actions/checkout@v3
- uses: ./.github/workflows/shared_steps

build-windows-2022:
# GitHub-hosted Windows 2022 runner
runs-on: windows-2022
# Use shared steps
steps:
- *shared-steps
- uses: actions/checkout@v3
- uses: ./.github/workflows/shared_steps
34 changes: 34 additions & 0 deletions .github/workflows/shared_steps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Shared Build Steps"
runs:
using: "composite"
steps:
# Build and install all dependencies to RDK installation directory.
- name: Build and install dependencies
run: |
cd ${{github.workspace}}
cd thirdparty
bash build_and_install_dependencies.sh ~/rdk_install 4
# Configure CMake, then build and install flexiv_rdk library to RDK installation directory.
- name: Build and install library
run: |
cd ${{github.workspace}}
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
make install
# Find and link to flexiv_rdk library, then build all example programs.
- name: Build examples
run: |
cd ${{github.workspace}}/example
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
make -j4
# Find and link to flexiv_rdk library, then build all test programs.
- name: Build tests
run: |
cd ${{github.workspace}}/test
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
make -j4

0 comments on commit 98c7d41

Please sign in to comment.