ruheng is run GitHub Actions π #28
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: GitHub Actions CI | |
run-name: ${{ github.actor }} is run GitHub Actions π | |
on: [push] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GIT_TOKEN }} | |
- name: Install dependence | |
run: | | |
sudo apt install -y qemu-user-static binfmt-support | |
- name: Download code | |
uses: actions/checkout@v3 | |
- name: Build and code test | |
run: | | |
docker pull ghcr.io/miroboticslab/cyberdog:v1 | |
docker run -i -v $GITHUB_WORKSPACE:/home/ros2/src ghcr.io/miroboticslab/cyberdog:v1 bash -c \ | |
"cd /home/ros2 && source /opt/ros2/galactic/setup.bash \ | |
&& colcon build --packages-up-to cyberdog_bringup \ | |
&& colcon test --event-handlers console_cohesion+ --return-code-on-test-failure --packages-select cyberdog_bringup" | |
# colcon build test |