|
| 1 | +# This file is automatically synced from: |
| 2 | +# https://github.com/autowarefoundation/sync-file-templates |
| 3 | +# To make changes, update the source repository and follow the guidelines in its README. |
| 4 | + |
1 | 5 | name: build-and-test-differential
|
2 | 6 |
|
3 | 7 | on:
|
4 | 8 | pull_request:
|
| 9 | + types: |
| 10 | + - opened |
| 11 | + - synchronize |
| 12 | + - reopened |
| 13 | + - labeled |
5 | 14 |
|
6 | 15 | jobs:
|
| 16 | + make-sure-label-is-present: |
| 17 | + uses: autowarefoundation/autoware-github-actions/.github/workflows/make-sure-label-is-present.yaml@v1 |
| 18 | + with: |
| 19 | + label: run:build-and-test-differential |
| 20 | + |
7 | 21 | build-and-test-differential:
|
8 |
| - runs-on: ubuntu-latest |
| 22 | + needs: make-sure-label-is-present |
| 23 | + if: ${{ needs.make-sure-label-is-present.outputs.result == 'true' }} |
| 24 | + runs-on: ubuntu-22.04 |
9 | 25 | container: ${{ matrix.container }}
|
10 | 26 | strategy:
|
11 | 27 | fail-fast: false
|
12 | 28 | matrix:
|
13 | 29 | rosdistro:
|
14 |
| - - galactic |
15 | 30 | - humble
|
16 | 31 | include:
|
17 |
| - - rosdistro: galactic |
18 |
| - container: ros:galactic |
19 |
| - build-depends-repos: build_depends.repos |
20 | 32 | - rosdistro: humble
|
21 | 33 | container: ros:humble
|
22 | 34 | build-depends-repos: build_depends.repos
|
23 | 35 | steps:
|
24 |
| - - name: Cancel previous runs |
25 |
| - uses: styfle/cancel-workflow-action@0.9.1 |
| 36 | + - name: Set PR fetch depth |
| 37 | + run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" |
26 | 38 |
|
27 |
| - - name: Check out repository |
28 |
| - uses: actions/checkout@v3 |
| 39 | + - name: Checkout PR branch and all PR commits |
| 40 | + uses: actions/checkout@v4 |
29 | 41 | with:
|
30 |
| - fetch-depth: 0 |
| 42 | + ref: ${{ github.event.pull_request.head.sha }} |
| 43 | + fetch-depth: ${{ env.PR_FETCH_DEPTH }} |
| 44 | + |
| 45 | + - name: Show disk space before the tasks |
| 46 | + run: df -h |
31 | 47 |
|
32 | 48 | - name: Remove exec_depend
|
33 | 49 | uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
|
@@ -55,35 +71,12 @@ jobs:
|
55 | 71 |
|
56 | 72 | - name: Upload coverage to CodeCov
|
57 | 73 | if: ${{ steps.test.outputs.coverage-report-files != '' }}
|
58 |
| - uses: codecov/codecov-action@v3 |
| 74 | + uses: codecov/codecov-action@v4 |
59 | 75 | with:
|
60 | 76 | files: ${{ steps.test.outputs.coverage-report-files }}
|
61 | 77 | fail_ci_if_error: false
|
62 | 78 | verbose: true
|
63 | 79 | flags: differential
|
64 | 80 |
|
65 |
| - clang-tidy-differential: |
66 |
| - runs-on: ubuntu-latest |
67 |
| - container: ros:galactic |
68 |
| - needs: build-and-test-differential |
69 |
| - steps: |
70 |
| - - name: Check out repository |
71 |
| - uses: actions/checkout@v3 |
72 |
| - with: |
73 |
| - fetch-depth: 0 |
74 |
| - |
75 |
| - - name: Remove exec_depend |
76 |
| - uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 |
77 |
| - |
78 |
| - - name: Get modified packages |
79 |
| - id: get-modified-packages |
80 |
| - uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 |
81 |
| - |
82 |
| - - name: Run clang-tidy |
83 |
| - if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }} |
84 |
| - uses: autowarefoundation/autoware-github-actions/clang-tidy@v1 |
85 |
| - with: |
86 |
| - rosdistro: galactic |
87 |
| - target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} |
88 |
| - clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy |
89 |
| - build-depends-repos: build_depends.repos |
| 81 | + - name: Show disk space after the tasks |
| 82 | + run: df -h |
0 commit comments