7e4a55c39d
feat: 添加 AIMRT github action Key features of this workflow: Runs automated tests on the mentioned platforms using matrix strategy in GitHub Actions. Ensures that the code compiles and runs correctly on each platform. The workflow is automatically triggered whenever the "ci ready" label is applied to a pull request or a new release is published, ensuring thorough testing and validation at critical stages of the development process. --------- Co-authored-by: yuguanlin <yuguanlin@agibot.com>
68 lines
1.6 KiB
YAML
68 lines
1.6 KiB
YAML
name: build Workflow
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
image_name:
|
|
required: true
|
|
type: string
|
|
default: ubuntu
|
|
image_tag:
|
|
required: false
|
|
type: string
|
|
default: latest
|
|
run_platform:
|
|
required: false
|
|
type: string
|
|
default: amd64
|
|
secrets:
|
|
TEST_CMD:
|
|
required: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ inputs.run_platform }}
|
|
container:
|
|
image: ${{ inputs.image_name }}:${{ inputs.image_tag }}
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
env:
|
|
https_proxy: ${{ secrets.https_proxy }}
|
|
http_proxy: ${{ secrets.http_proxy }}
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Run build stage
|
|
env:
|
|
https_proxy: ""
|
|
http_proxy: ""
|
|
no_proxy: "*"
|
|
shell: bash
|
|
run: |
|
|
if [ -d "./build" ]; then
|
|
ls -lah ./build
|
|
fi
|
|
|
|
echo "removing CMakeCache.txt"
|
|
rm -rf ./build/CMakeCache.txt
|
|
|
|
source /opt/ros/humble/setup.bash
|
|
eval "${{ secrets.BUILD_CMD}}"
|
|
|
|
echo "ls -lah ${{vars.PROJECT_ARTIFACTS_DIR}}"
|
|
ls -lah ${{vars.PROJECT_ARTIFACTS_DIR}}
|
|
|
|
echo "ls -lah ${{vars.WHL_ARTIFACTS_DIR}}"
|
|
ls -lah ${{vars.WHL_ARTIFACTS_DIR}}
|
|
|
|
- name: upload build artifact
|
|
if: github.action
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: build_artifact
|
|
path: |
|
|
${{vars.WHL_ARTIFACTS_DIR}}
|
|
retention-days: 3
|
|
|