|
| 1 | +name: build-and-test-differential-openadk |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: |
| 6 | + - opened |
| 7 | + - synchronize |
| 8 | + - labeled |
| 9 | + |
| 10 | +jobs: |
| 11 | + prevent-no-label-execution: |
| 12 | + uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1 |
| 13 | + with: |
| 14 | + label: tag:run-build-and-test-differential |
| 15 | + |
| 16 | + build-and-test-differential: |
| 17 | + needs: prevent-no-label-execution |
| 18 | + if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }} |
| 19 | + runs-on: ubuntu-latest |
| 20 | + container: ${{ matrix.container }}${{ matrix.container-suffix }} |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + matrix: |
| 24 | + rosdistro: |
| 25 | + - humble |
| 26 | + container-suffix: |
| 27 | + - "" |
| 28 | + - -cuda |
| 29 | + include: |
| 30 | + - rosdistro: humble |
| 31 | + container: ghcr.io/autowarefoundation/autoware-openadk:latest-prebuilt |
| 32 | + build-depends-repos: build_depends.repos |
| 33 | + steps: |
| 34 | + - name: Check out repository |
| 35 | + uses: actions/checkout@v3 |
| 36 | + with: |
| 37 | + fetch-depth: 0 |
| 38 | + |
| 39 | + - name: Check disk space before build |
| 40 | + run: df -h |
| 41 | + |
| 42 | + - name: Remove exec_depend |
| 43 | + uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 |
| 44 | + |
| 45 | + - name: Get modified packages |
| 46 | + id: get-modified-packages |
| 47 | + uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 |
| 48 | + |
| 49 | + - name: Build |
| 50 | + if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} |
| 51 | + uses: autowarefoundation/autoware-github-actions/colcon-build@v1 |
| 52 | + with: |
| 53 | + rosdistro: ${{ matrix.rosdistro }} |
| 54 | + target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} |
| 55 | + build-depends-repos: ${{ matrix.build-depends-repos }} |
| 56 | + |
| 57 | + - name: Test |
| 58 | + id: test |
| 59 | + if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} |
| 60 | + uses: autowarefoundation/autoware-github-actions/colcon-test@v1 |
| 61 | + with: |
| 62 | + rosdistro: ${{ matrix.rosdistro }} |
| 63 | + target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} |
| 64 | + build-depends-repos: ${{ matrix.build-depends-repos }} |
| 65 | + |
| 66 | + - name: Upload coverage to CodeCov |
| 67 | + if: ${{ steps.test.outputs.coverage-report-files != '' }} |
| 68 | + uses: codecov/codecov-action@v3 |
| 69 | + with: |
| 70 | + files: ${{ steps.test.outputs.coverage-report-files }} |
| 71 | + fail_ci_if_error: false |
| 72 | + verbose: true |
| 73 | + flags: differential |
| 74 | + |
| 75 | + - name: Check disk space after build |
| 76 | + run: df -h |
| 77 | + |
| 78 | + clang-tidy-differential: |
| 79 | + runs-on: [self-hosted, linux, X64] |
| 80 | + container: ghcr.io/autowarefoundation/autoware-universe:humble-latest-cuda |
| 81 | + needs: build-and-test-differential |
| 82 | + steps: |
| 83 | + - name: Check out repository |
| 84 | + uses: actions/checkout@v3 |
| 85 | + with: |
| 86 | + fetch-depth: 0 |
| 87 | + |
| 88 | + - name: Remove exec_depend |
| 89 | + uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 |
| 90 | + |
| 91 | + - name: Get modified packages |
| 92 | + id: get-modified-packages |
| 93 | + uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 |
| 94 | + |
| 95 | + - name: Get modified files |
| 96 | + id: get-modified-files |
| 97 | + uses: tj-actions/changed-files@v35 |
| 98 | + with: |
| 99 | + files: | |
| 100 | + **/*.cpp |
| 101 | + **/*.hpp |
| 102 | +
|
| 103 | + - name: Run clang-tidy |
| 104 | + if: ${{ steps.get-modified-files.outputs.all_changed_files != '' }} |
| 105 | + uses: autowarefoundation/autoware-github-actions/clang-tidy@v1 |
| 106 | + with: |
| 107 | + rosdistro: humble |
| 108 | + target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} |
| 109 | + target-files: ${{ steps.get-modified-files.outputs.all_changed_files }} |
| 110 | + clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy |
| 111 | + build-depends-repos: build_depends.repos |
0 commit comments