From b52b1ae6ca3f636c7ee7a0829d766ffdb01e20f8 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Fri, 13 Dec 2024 13:58:34 +0100 Subject: [PATCH] Clean up --- .github/workflows/build-docker.yaml | 11 ---- .github/workflows/release-candidate.yaml | 52 ++++++++----------- .github/workflows/release-project.yaml | 29 ++++------- .github/workflows/release-repository.yaml | 5 +- .../{run-unit-tests.yaml => unit-tests.yaml} | 2 +- husarion_ugv/package.xml | 2 +- 6 files changed, 38 insertions(+), 63 deletions(-) rename .github/workflows/{run-unit-tests.yaml => unit-tests.yaml} (99%) diff --git a/.github/workflows/build-docker.yaml b/.github/workflows/build-docker.yaml index 7eb0a97a..e2d3c64c 100644 --- a/.github/workflows/build-docker.yaml +++ b/.github/workflows/build-docker.yaml @@ -4,11 +4,6 @@ name: Build Docker on: workflow_call: inputs: - codebase_version: - description: Version of the panther_ros to be used in the docker image (branch/tag/commit). - required: true - type: string - default: ros2-devel build_type: description: Is it a "development" or a "stable" release? required: true @@ -31,11 +26,6 @@ on: default: '20131206' workflow_dispatch: inputs: - codebase_version: - description: Version of the panther_ros to be used in the docker image (branch/tag/commit). - required: true - type: string - default: ros2-devel build_type: description: Is it a "development" or a "stable" release? required: true @@ -86,7 +76,6 @@ jobs: main_branch_name: ros2 dockerfile: ${{ matrix.dockerfile }} repo_name: ${{ matrix.repo_name }} - branch_name: ${{ inputs.panther_codebase_version }} build_type: ${{ inputs.build_type }} ros_distro: ${{ matrix.ros_distro }} platforms: ${{ matrix.platforms }} diff --git a/.github/workflows/release-candidate.yaml b/.github/workflows/release-candidate.yaml index 8aa3b541..3b761fe9 100644 --- a/.github/workflows/release-candidate.yaml +++ b/.github/workflows/release-candidate.yaml @@ -15,11 +15,11 @@ env: RC_BRANCH_NAME: ${{ github.event.inputs.version }}-${{ github.event.inputs.date }} jobs: - check_docs: - name: Check docs build + docs: + name: Docs runs-on: ubuntu-22.04 steps: - - name: Trigger repository build workflow + - name: Check docs build uses: convictional/trigger-workflow-and-wait@v1.6.1 with: owner: husarion @@ -29,24 +29,24 @@ jobs: ref: master client_payload: '{"husarion_ugv_branch": "ros2-devel"}' - # TODO: Add unit testing for panther_ros when ready - unit_test_panther_ros: - name: Run unit tests for panther_ros + # TODO: Add unit testing when ready + unit_tests: + name: Unit tests runs-on: ubuntu-22.04 steps: - - name: Trigger repository build workflow + - name: Run unit tests run: echo "Unit tests for panther_ros are not fully implemented yet -> SKIPPING!" - create_release_candidate_branches: - name: Create release candidate branches + create_branches: + name: Create branches runs-on: ubuntu-22.04 needs: - - unit_test_panther_ros + - unit_tests strategy: matrix: repo: [panther_ros, panther-rpi-os-img] steps: - - name: Create test branch + - name: Create release candidate branch uses: GuillaumeFalourd/create-other-repo-branch-action@v1.5 with: repository_owner: husarion @@ -56,10 +56,10 @@ jobs: access_token: ${{ secrets.GH_PAT}} update_tags_in_compose: - name: Update Docker image tags in compose + name: Update tags in compose runs-on: ubuntu-22.04 needs: - - create_release_candidate_branches + - create_branches steps: - name: Checkout uses: actions/checkout@v4 @@ -73,32 +73,31 @@ jobs: sed -i 's/\(husarion\/panther:humble-\)[^[:space:]]*/\1${{ env.RC_BRANCH_NAME }}/g' docker/demo/compose.hardware.yaml sed -i 's/\(husarion\/panther-gazebo:humble-\)[^[:space:]]*/\1${{ env.RC_BRANCH_NAME }}/g' docker/demo/compose.simulation.yaml - - name: Commit changes to target branch + - name: Commit changes uses: EndBug/add-and-commit@v9 with: - message: Update docker image tag + message: Update tags in compose files author_name: action-bot author_email: action-bot@action-bot.com - build_docker: - name: Build Docker + docker: + name: Docker runs-on: ubuntu-22.04 needs: - update_tags_in_compose steps: - - name: Build development Docker + - name: Build Docker uses: ./.github/workflows/build-docker.yml with: - codebase_version: ${{ env.RC_BRANCH_NAME }} build_type: development - build_and_publish_rpi_image: - name: Build panther system image + os_image: + name: OS image needs: - update_tags_in_compose runs-on: ubuntu-22.04 steps: - - name: Trigger repository build workflow + - name: Build OS image uses: convictional/trigger-workflow-and-wait@v1.6.1 with: owner: husarion @@ -113,14 +112,7 @@ jobs: "image_tag": "${{ github.event.inputs.version }}" } - build_and_publish_rpi_flash_os_image: - name: Build panther flash OS image - if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }} - needs: - - build_and_publish_rpi_image - runs-on: ubuntu-22.04 - steps: - - name: Trigger repository build workflow + - name: Build flash OS image uses: convictional/trigger-workflow-and-wait@v1.6.1 with: owner: husarion diff --git a/.github/workflows/release-project.yaml b/.github/workflows/release-project.yaml index 89eacff1..c756f7e9 100644 --- a/.github/workflows/release-project.yaml +++ b/.github/workflows/release-project.yaml @@ -31,30 +31,21 @@ env: jobs: release_project: - name: Release Husarion UGV project + name: Release project runs-on: ubuntu-22.04 steps: - name: Release panther_ros repository - uses: convictional/trigger-workflow-and-wait@v1.6.1 + uses: ./.github/workflows/release-repository.yaml with: - owner: husarion - repo: panther_ros - github_token: ${{ secrets.GITHUB_TOKEN }} # Use the default GITHUB_TOKEN for local repository - workflow_file_name: release-repository.yaml - ref: ${{ env.RC_BRANCH_NAME }} - client_payload: | - { - "release_candidate": "${{ env.RC_BRANCH_NAME }}", - "version": "${{ github.event.inputs.version }}", - "release_name": "${{ github.event.inputs.release_name }}", - "automatic_mode": "${{ github.event.inputs.automatic_mode }}", - "prerelease": "${{ github.event.inputs.prerelease }}" - } + release_candidate: ${{ env.RC_BRANCH_NAME }} + version: ${{ github.event.inputs.version }} + release_name: ${{ github.event.inputs.release_name }} + automatic_mode: ${{ github.event.inputs.automatic_mode }} + prerelease: ${{ github.event.inputs.prerelease }} - name: Build development Docker uses: ./.github/workflows/build-docker.yml with: - codebase_version: ${{ github.event.inputs.version }} build_type: development - name: Release panther-rpi-os-img repository @@ -74,7 +65,7 @@ jobs: "prerelease": "${{ github.event.inputs.prerelease }}" } - - name: Build panther system image + - name: Build OS image if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }} uses: convictional/trigger-workflow-and-wait@v1.6.1 with: @@ -90,7 +81,7 @@ jobs: "image_tag": "${{ github.event.inputs.version }}" } - - name: Build panther flash OS image + - name: Build flash OS image if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }} uses: convictional/trigger-workflow-and-wait@v1.6.1 with: @@ -104,7 +95,7 @@ jobs: "image_tag": "${{ github.event.inputs.version }}" } - - name: Trigger repository build workflow + - name: Rebuild documentation uses: convictional/trigger-workflow-and-wait@v1.6.1 with: owner: husarion diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index 8932fcd4..498a304d 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -2,18 +2,21 @@ name: Release Repository on: - workflow_dispatch: + workflow_call: inputs: release_candidate: description: Branch name of the release candidate. WARNING This branch will be deleted! required: true + type: string version: description: New version (used for tag and package versioning). required: true + type: string release_name: description: Name of the release to be created. Version in the first place is recommended (e.g. `2.0.0-alpha`). required: true + type: string automatic_mode: type: boolean default: false diff --git a/.github/workflows/run-unit-tests.yaml b/.github/workflows/unit-tests.yaml similarity index 99% rename from .github/workflows/run-unit-tests.yaml rename to .github/workflows/unit-tests.yaml index bd538256..5cfecd9a 100644 --- a/.github/workflows/run-unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -1,5 +1,5 @@ --- -name: Run unit tests +name: Unit tests on: workflow_dispatch: diff --git a/husarion_ugv/package.xml b/husarion_ugv/package.xml index 2365d2eb..5d992db7 100644 --- a/husarion_ugv/package.xml +++ b/husarion_ugv/package.xml @@ -15,7 +15,7 @@ ament_cmake - husarion_ugv_bringup + husarion_ugv_bringup husarion_ugv_gazebo