Remove scenario module config from launch file to pass the CI. Should… #5
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: 'build' | |
on: # rebuild any PRs and main branch changes | |
pull_request: | |
branches: | |
- dev | |
push: | |
branches: | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout (GitHub) | |
uses: actions/checkout@v3 | |
- name: Create src directory | |
run: mkdir -p src | |
- name: Disable NVidia runtime in the container | |
run: sed -i '/"--runtime=nvidia",/d' .devcontainer/devcontainer.json | |
# - name: Checkout private planner | |
# uses: actions/checkout@v3 | |
# with: | |
# repository: oscardegroot/mpc_planner | |
# token: ${{ secrets.CI_REPO_PAT }} | |
# path: src/mpc_planner | |
# ref: dev | |
- name: Build dev container task | |
uses: devcontainers/ci@v0.3 | |
with: | |
runCmd: | | |
chmod +x setup.sh | |
chmod +x build.sh | |
./setup.sh -y | |
./build.sh jackalsimulator True | |
- name: Run dev container task | |
uses: devcontainers/ci@v0.3 | |
with: | |
runCmd: | | |
source /opt/ros/noetic/setup.sh && source /workspace/devel/setup.bash && source /workspace/fix_console.sh && roslaunch mpc_planner_jackalsimulator ros1_jackalsimulator.launch | |
- name: Check result | |
id: check_file | |
uses: devcontainers/ci@v0.3 | |
with: | |
runCmd: | | |
FILE="/workspace/src/mpc_planner/data/none.txt" | |
MIN_SIZE_KB=10 # Set the minimum file size in KB | |
if [ -f "$FILE" ]; then | |
FILE_SIZE=$(du -k "$FILE" | cut -f1) # Get file size in KB | |
if [ "$FILE_SIZE" -ge "$MIN_SIZE_KB" ]; then | |
echo "File size is greater than or equal to ${MIN_SIZE_KB} KB" | |
echo "::set-output name=file_large_enough::true" | |
else | |
echo "File size is smaller than ${MIN_SIZE_KB} KB" | |
echo "::set-output name=file_large_enough::false" | |
exit 1 # Exit with failure if the file size is too small | |
fi | |
else | |
echo "File does not exist" | |
echo "::set-output name=file_large_enough::false" | |
exit 1 # Exit with failure if the file doesn't exist | |
fi | |
# Step 3: Do something if the file is large enough | |
- name: Run step if file size is large enough | |
uses: devcontainers/ci@v0.3 | |
if: steps.check_file.outputs.file_large_enough == 'true' | |
with: | |
runCmd: | | |
echo "Running the experiment succeeded." |