From 6bffae962842bb94400ffe3c7a624d4de5cb3576 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 1 Nov 2023 11:04:34 +0700 Subject: [PATCH 1/6] ci: rename workflow config file to `test.yaml` --- .github/workflows/{action-test.yml => test.yaml} | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{action-test.yml => test.yaml} (98%) diff --git a/.github/workflows/action-test.yml b/.github/workflows/test.yaml similarity index 98% rename from .github/workflows/action-test.yml rename to .github/workflows/test.yaml index 19d91b0..64331f3 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/test.yaml @@ -1,4 +1,4 @@ -name: Action Test +name: Test on: workflow_dispatch: pull_request: diff --git a/README.md b/README.md index 1b4507d..51ef611 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![latest version](https://img.shields.io/github/v/release/ichiro-its/ros2-build-and-test-action)](https://github.com/ichiro-its/ros2-build-and-test-action/releases/) [![commits since latest version](https://img.shields.io/github/commits-since/ichiro-its/ros2-build-and-test-action/latest)](https://github.com/ichiro-its/ros2-build-and-test-action/releases/) [![license](https://img.shields.io/github/license/ichiro-its/ros2-build-and-test-action)](./LICENSE) -[![test status](https://img.shields.io/github/workflow/status/ichiro-its/ros2-build-and-test-action/Action%20Test?label=test)](https://github.com/ichiro-its/ros2-build-and-test-action/actions) +[![test status](https://img.shields.io/github/workflow/status/ichiro-its/ros2-build-and-test-action/test.yaml?label=test&branch=main)](https://github.com/ichiro-its/ros2-build-and-test-action/actions/workflows/test.yaml) This action could be used to build and test a [ROS 2](https://www.ros.org/) workspace from source. From 07e97897c5df5fce92b7aeca544e6b12ec4c98a7 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 1 Nov 2023 11:07:22 +0700 Subject: [PATCH 2/6] ci: trigger Test workflow in any pull request --- .github/workflows/test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 64331f3..5c47722 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,7 +2,6 @@ name: Test on: workflow_dispatch: pull_request: - branches: [main] push: branches: [main] jobs: From afd5bd7d66971717a4e4b693cb509adad2b38537 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 1 Nov 2023 11:09:58 +0700 Subject: [PATCH 3/6] ci: disable fail fast in job with matrix strategy --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5c47722..6aeda20 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,6 +8,7 @@ jobs: action-test: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: include: - os: ubuntu-22.04 @@ -47,6 +48,7 @@ jobs: action-test-failure: runs-on: ubuntu-20.04 strategy: + fail-fast: false matrix: package: [failed_build, failed_test] steps: From 1fd5d27f49e0ee5f11eb343e3290abe68eb52956 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 1 Nov 2023 11:13:33 +0700 Subject: [PATCH 4/6] ci: separate `action-test-failure` job --- .github/workflows/test.yaml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6aeda20..ba43682 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -45,26 +45,42 @@ jobs: name: Install path: install - action-test-failure: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - package: [failed_build, failed_test] + action-test-failed-build: + runs-on: ubuntu-22.04 steps: - name: Checkout this repository uses: actions/checkout@v2.3.4 - name: Only test some packages run: | - mv test/${{ matrix.package }} ${{ matrix.package }} || true - rm -rf examples test || true + mv test/failed_build failed_build + rm -rf examples test + + - name: Test the action + id: action + continue-on-error: true + uses: ./ + + - name: Fails if previous step has succeeded + if: ${{ steps.action.outcome == 'success' }} + run: false + + action-test-failed-test: + runs-on: ubuntu-22.04 + steps: + - name: Checkout this repository + uses: actions/checkout@v2.3.4 + + - name: Only test some packages + run: | + mv test/failed_test failed_test + rm -rf examples test - name: Test the action - id: failedstep + id: action continue-on-error: true uses: ./ - name: Fails if previous step has succeeded - if: ${{ steps.failedstep.outcome == 'success' }} + if: ${{ steps.action.outcome == 'success' }} run: false From 69f19f8157f1cc656bb7c93a1909b81dd6b891f1 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 1 Nov 2023 11:15:12 +0700 Subject: [PATCH 5/6] ci: adjust the matrix strategy in the `action-test` job --- .github/workflows/test.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ba43682..21ee224 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,15 +6,11 @@ on: branches: [main] jobs: action-test: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: - include: - - os: ubuntu-22.04 - ros2-distro: humble - - os: ubuntu-22.04 - ros2-distro: iron + ros2-distro: [humble, iron] steps: - name: Checkout this repository uses: actions/checkout@v2.3.4 From b4b8f86dbf9bf53e5836360837af9c0a76834eea Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 1 Nov 2023 11:21:03 +0700 Subject: [PATCH 6/6] ci: adjust jobs name in the Test workflow --- .github/workflows/test.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 21ee224..5300962 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,7 +5,8 @@ on: push: branches: [main] jobs: - action-test: + build-and-test: + name: Build and Test runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -41,7 +42,8 @@ jobs: name: Install path: install - action-test-failed-build: + failed-build: + name: Failed Build runs-on: ubuntu-22.04 steps: - name: Checkout this repository @@ -61,7 +63,8 @@ jobs: if: ${{ steps.action.outcome == 'success' }} run: false - action-test-failed-test: + failed-test: + name: Failed Test runs-on: ubuntu-22.04 steps: - name: Checkout this repository