Skip to content

Commit

Permalink
splitted actions in push and pr, added more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderBarbie committed Sep 1, 2024
1 parent 054dac5 commit 70b865c
Show file tree
Hide file tree
Showing 33 changed files with 700 additions and 176 deletions.
85 changes: 0 additions & 85 deletions .github/workflows/build-x64.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/pr-arm32v7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PiCar-X PR Build (RPI3)

on: [pull_request, workflow_dispatch]

env:
REGISTRY: ghcr.io

jobs:
build:
runs-on: [self-hosted, Linux, ARM]

steps:
- uses: actions/checkout@v4
- name: build core container
working-directory: ./PiCar-X
run: |
TAG=${{ github.sha }} ARCH=arm32v7 docker compose -f docker-compose-core.yml build --no-cache
- uses: actions/checkout@v4
- name: build dtp containers without gazebo
working-directory: ./PiCar-X
run: |
TAG=${{ github.sha }} ARCH=arm32v7 docker compose -f docker-compose-dtp-no-gazebo.yml build --no-cache
unit-tests:
runs-on: [self-hosted, Linux, ARM]
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Run pytest in Docker container
working-directory: ./PiCar-X
run: |
docker run --rm --name picarx-unittest ghcr.io/cau-se/arches-picar-x/picarx:${{ github.sha }} pytest ./src/core/picarx/tests
integration-tests:
runs-on: [self-hosted, Linux, ARM]
needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Integration Test dcmotor
working-directory: ./PiCar-X
run: |
docker run --rm --name dcmotor-integration-test -v /sys/class/gpio:/sys/class/gpio -v /dev/i2c-11:/dev/i2c-11 --privileged ghcr.io/cau-se/arches-picar-x/drivers/dcmotor:${{ github.sha }} rostest picarx_dcmotor_driver integration_tests.test i2c_port:=/dev/i2c-11
43 changes: 43 additions & 0 deletions .github/workflows/pr-arm64v8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PiCar-X PR Build (RPI4)

on: [pull_request, workflow_dispatch]

env:
REGISTRY: ghcr.io

jobs:
build:
runs-on: [self-hosted, Linux, ARM64]

steps:
- uses: actions/checkout@v4
- name: build core container
working-directory: ./PiCar-X
run: |
TAG=${{ github.sha }} ARCH=arm64v8 docker compose -f docker-compose-core.yml build --no-cache
- uses: actions/checkout@v4
- name: build dtp containers without gazebo
working-directory: ./PiCar-X
run: |
TAG=${{ github.sha }} ARCH=arm64v8 docker compose -f docker-compose-dtp-no-gazebo.yml build --no-cache
unit-tests:
runs-on: [self-hosted, Linux, ARM64]
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Run pytest in Docker container
working-directory: ./PiCar-X
run: |
docker run --rm --name picarx-unittest ghcr.io/cau-se/arches-picar-x/picarx:${{ github.sha }} pytest ./src/core/picarx/tests
integration-tests:
runs-on: [self-hosted, Linux, ARM64]
needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Integration Test dcmotor
working-directory: ./PiCar-X
run: |
docker run --rm --name dcmotor-integration-test -v /sys/class/gpio:/sys/class/gpio -v /dev/i2c-11:/dev/i2c-11 --privileged ghcr.io/cau-se/arches-picar-x/drivers/dcmotor:${{ github.sha }} rostest picarx_dcmotor_driver integration_tests.test i2c_port:=/dev/i2c-11
56 changes: 56 additions & 0 deletions .github/workflows/pr-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PiCar-X Main Build

on: [pull_request, workflow_dispatch]

env:
REGISTRY: ghcr.io

jobs:
build:
runs-on: [self-hosted, Linux, X64]

steps:
- uses: actions/checkout@v4
- name: build core container
working-directory: ./PiCar-X
run: |
TAG=${{ github.sha }} docker compose -f docker-compose-core.yml build --no-cache
- name: build dtp containers without gazebo
working-directory: ./PiCar-X
run: |
TAG=${{ github.sha }} docker compose -f docker-compose-dtp-headless-gazebo.yml build --no-cache
unit-tests:
runs-on: [self-hosted, Linux, X64]
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Run pytest in Docker container
working-directory: ./PiCar-X
run: |
docker run --rm --name picarx-unittest ghcr.io/cau-se/arches-picar-x/picarx:${{ github.sha }} pytest ./src/core/picarx/tests
integration-tests:
runs-on: [self-hosted, Linux, X64]
needs: [unit-tests]
steps:
- uses: actions/checkout@v4

- name: Integration Test dcmotor
working-directory: ./PiCar-X
run: |
docker run --rm --name dcmotor-integration-test -v /sys/class/gpio:/sys/class/gpio -v /dev/i2c-0:/dev/i2c-0 --privileged ghcr.io/cau-se/arches-picar-x/drivers/dcmotor:${{ github.sha }} rostest picarx_dcmotor_driver integration_tests.test i2c_port:=/dev/i2c-0
- name: Speed tests using Gazebo headless
working-directory: ./PiCar-X
run: |
i2c=/dev/i2c-0 docker compose -f docker-compose-dtp-headless-gazebo.yml up -d
docker exec picar-x-picarx-gazebo-control-1 /bin/bash -c "source ./install/setup.bash && sleep 30; python3 ./src/simulation/picarx_control/tests/steering_integration_test.py"
- name: Remove running containers after tests
if: success() || failure()
working-directory: ./PiCar-X
run: |
docker compose -f docker-compose-dtp-headless-gazebo.yml down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PiCar-X Main Build (RPI3)
name: PiCar-X Main Build on PUSH (RPI3)

on: [pull_request, workflow_dispatch]

Expand All @@ -10,16 +10,6 @@ jobs:
runs-on: [self-hosted, Linux, ARM]

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4
- name: build core container
working-directory: ./PiCar-X
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: PiCar-X Main Build (RPI4)
name: PiCar-X Main Build on PUSH (RPI4)

on: [pull_request, workflow_dispatch]

env:
Expand All @@ -9,16 +10,6 @@ jobs:
runs-on: [self-hosted, Linux, ARM64]

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4
- name: build core container
working-directory: ./PiCar-X
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/push-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: PiCar-X Main Build on PUSH (RPI3)

on: [push, workflow_dispatch]

env:
REGISTRY: ghcr.io

jobs:
build:
runs-on: [self-hosted, Linux, ARM]

steps:
- uses: actions/checkout@v4
- name: build core container
working-directory: ./PiCar-X
run: |
TAG=latest ARCH=arm32v7 docker compose -f docker-compose-core.yml build --no-cache
- uses: actions/checkout@v4
- name: build dtp containers without gazebo
working-directory: ./PiCar-X
run: |
TAG=latest ARCH=arm32v7 docker compose -f docker-compose-dtp-no-gazebo.yml build --no-cache
unit-tests:
runs-on: [self-hosted, Linux, ARM]
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Run pytest in Docker container
working-directory: ./PiCar-X
run: |
docker run --rm --name picarx-unittest ghcr.io/cau-se/arches-picar-x/picarx:latest pytest ./src/core/picarx/tests
integration-tests:
runs-on: [self-hosted, Linux, ARM]
needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Integration Test dcmotor
working-directory: ./PiCar-X
run: |
docker run --rm --name dcmotor-integration-test -v /sys/class/gpio:/sys/class/gpio -v /dev/i2c-11:/dev/i2c-11 --privileged ghcr.io/cau-se/arches-picar-x/drivers/dcmotor:latest rostest picarx_dcmotor_driver integration_tests.test i2c_port:=/dev/i2c-11
release:
runs-on: [self-hosted, Linux, ARM]
needs: [integration-tests]
steps:
- uses: actions/checkout@v4
with:
path: ${{ github.sha }}

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push to ghcr.io
working-directory: ./PiCar-X
run: |
TAG=latest docker compose -f docker-compose-dtp-no-gazebo.yml push
Loading

0 comments on commit 70b865c

Please sign in to comment.