|
| 1 | +name: build-and-test-differential |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build-and-test-differential: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + container: ${{ matrix.container }} |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + rosdistro: |
| 14 | + - humble |
| 15 | + include: |
| 16 | + - rosdistro: humble |
| 17 | + container: ros:humble |
| 18 | + build-depends-repos: build_depends.repos |
| 19 | + steps: |
| 20 | + - name: Check out repository |
| 21 | + uses: actions/checkout@v3 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + |
| 25 | + - name: Remove exec_depend |
| 26 | + uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 |
| 27 | + |
| 28 | + - name: Get modified packages |
| 29 | + id: get-modified-packages |
| 30 | + uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 |
| 31 | + |
| 32 | + - name: Build |
| 33 | + if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} |
| 34 | + uses: autowarefoundation/autoware-github-actions/colcon-build@v1 |
| 35 | + with: |
| 36 | + rosdistro: ${{ matrix.rosdistro }} |
| 37 | + target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} |
| 38 | + build-depends-repos: ${{ matrix.build-depends-repos }} |
| 39 | + |
| 40 | + - name: Test |
| 41 | + id: test |
| 42 | + if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} |
| 43 | + uses: autowarefoundation/autoware-github-actions/colcon-test@v1 |
| 44 | + with: |
| 45 | + rosdistro: ${{ matrix.rosdistro }} |
| 46 | + target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} |
| 47 | + build-depends-repos: ${{ matrix.build-depends-repos }} |
| 48 | + |
| 49 | + - name: Upload coverage to CodeCov |
| 50 | + if: ${{ steps.test.outputs.coverage-report-files != '' }} |
| 51 | + uses: codecov/codecov-action@v3 |
| 52 | + with: |
| 53 | + files: ${{ steps.test.outputs.coverage-report-files }} |
| 54 | + fail_ci_if_error: false |
| 55 | + verbose: true |
| 56 | + flags: differential |
| 57 | + |
| 58 | + clang-tidy-differential: |
| 59 | + runs-on: ubuntu-latest |
| 60 | + container: ros:humble |
| 61 | + needs: build-and-test-differential |
| 62 | + steps: |
| 63 | + - name: Check out repository |
| 64 | + uses: actions/checkout@v3 |
| 65 | + with: |
| 66 | + fetch-depth: 0 |
| 67 | + |
| 68 | + - name: Remove exec_depend |
| 69 | + uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 |
| 70 | + |
| 71 | + - name: Get modified packages |
| 72 | + id: get-modified-packages |
| 73 | + uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 |
| 74 | + |
| 75 | + - name: Get modified files |
| 76 | + id: get-modified-files |
| 77 | + uses: tj-actions/changed-files@v35 |
| 78 | + with: |
| 79 | + files: | |
| 80 | + **/*.cpp |
| 81 | + **/*.hpp |
| 82 | +
|
| 83 | + - name: Run clang-tidy |
| 84 | + if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }} |
| 85 | + uses: autowarefoundation/autoware-github-actions/clang-tidy@v1 |
| 86 | + with: |
| 87 | + rosdistro: humble |
| 88 | + target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} |
| 89 | + target-files: ${{ steps.get-modified-files.outputs.all_changed_files }} |
| 90 | + clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy |
| 91 | + build-depends-repos: build_depends.repos |
0 commit comments