Skip to content

Commit 79fff4d

Browse files
committed
chore: update & restore workflows
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
1 parent ee60c98 commit 79fff4d

6 files changed

Lines changed: 113 additions & 38 deletions

File tree

.github/sync-files.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@
1414
- source: .yamllint.yaml
1515
- source: CPPLINT.cfg
1616
- source: setup.cfg
17+
18+
- repository: autowarefoundation/sync-file-templates
19+
files:
20+
- source: .github/workflows/build-and-test.yaml
21+
- source: .github/workflows/build-and-test-differential.yaml
22+
- source: .github/workflows/check-build-depends.yaml
23+
- source: .github/workflows/clang-tidy-pr-comments.yaml
24+
- source: .github/workflows/sync-files.yaml

.github/workflows/build-and-test-differential.yaml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,57 @@
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+
15
name: build-and-test-differential
26

37
on:
48
pull_request:
9+
types:
10+
- opened
11+
- synchronize
12+
- reopened
13+
- labeled
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
17+
cancel-in-progress: true
518

619
jobs:
20+
require-label:
21+
uses: autowarefoundation/autoware-github-actions/.github/workflows/require-label.yaml@v1
22+
with:
23+
label: run:build-and-test-differential
24+
725
build-and-test-differential:
8-
runs-on: ubuntu-latest
26+
needs: require-label
27+
if: ${{ needs.require-label.outputs.result == 'true' }}
28+
runs-on: ubuntu-22.04
929
container: ${{ matrix.container }}
1030
strategy:
1131
fail-fast: false
1232
matrix:
1333
rosdistro:
14-
- jazzy
1534
- humble
35+
- jazzy
1636
include:
17-
- rosdistro: jazzy
18-
container: ros:jazzy
19-
build-depends-repos: build_depends.repos
2037
- rosdistro: humble
2138
container: ros:humble
2239
build-depends-repos: build_depends.repos
40+
- rosdistro: jazzy
41+
container: ros:jazzy
42+
build-depends-repos: build_depends.repos
2343
steps:
24-
- name: Cancel previous runs
25-
uses: styfle/cancel-workflow-action@0.12.1
44+
- name: Set PR fetch depth
45+
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
2646

27-
- name: Check out repository
47+
- name: Checkout PR branch and all PR commits
2848
uses: actions/checkout@v4
2949
with:
30-
fetch-depth: 0
50+
ref: ${{ github.event.pull_request.head.sha }}
51+
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
52+
53+
- name: Show disk space before the tasks
54+
run: df -h
3155

3256
- name: Remove exec_depend
3357
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
@@ -61,3 +85,6 @@ jobs:
6185
fail_ci_if_error: false
6286
verbose: true
6387
flags: differential
88+
89+
- name: Show disk space after the tasks
90+
run: df -h

.github/workflows/build-and-test.yaml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
name: build-and-test
26

37
on:
@@ -6,27 +10,36 @@ on:
610
- cron: 0 0 * * *
711
workflow_dispatch:
812

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
917
jobs:
1018
build-and-test:
1119
if: ${{ github.event_name != 'push' || github.ref_name == github.event.repository.default_branch }}
12-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-22.04
1321
container: ${{ matrix.container }}
1422
strategy:
1523
fail-fast: false
1624
matrix:
1725
rosdistro:
18-
- jazzy
1926
- humble
27+
- jazzy
2028
include:
21-
- rosdistro: jazzy
22-
container: ros:jazzy
23-
build-depends-repos: build_depends.repos
2429
- rosdistro: humble
2530
container: ros:humble
2631
build-depends-repos: build_depends.repos
32+
- rosdistro: jazzy
33+
container: ros:jazzy
34+
build-depends-repos: build_depends.repos
2735
steps:
2836
- name: Check out repository
2937
uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 1
40+
41+
- name: Show disk space before the tasks
42+
run: df -h
3043

3144
- name: Remove exec_depend
3245
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
@@ -60,3 +73,6 @@ jobs:
6073
fail_ci_if_error: false
6174
verbose: true
6275
flags: total
76+
77+
- name: Show disk space after the tasks
78+
run: df -h

.github/workflows/check-build-depends.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
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+
15
name: check-build-depends
26

37
on:
48
pull_request:
59
paths:
610
- build_depends*.repos
711

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
816
jobs:
917
check-build-depends:
10-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-22.04
1119
container: ${{ matrix.container }}
1220
strategy:
1321
fail-fast: false
1422
matrix:
1523
rosdistro:
16-
- jazzy
1724
- humble
1825
include:
19-
- rosdistro: jazzy
20-
container: ros:jazzy
21-
build-depends-repos: build_depends.repos
2226
- rosdistro: humble
2327
container: ros:humble
2428
build-depends-repos: build_depends.repos
@@ -38,4 +42,4 @@ jobs:
3842
with:
3943
rosdistro: ${{ matrix.rosdistro }}
4044
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
41-
build-depends-repos: ${{ matrix.build-depends-repos }}
45+
build-depends-repos: ${{ matrix.build-depends-repos }}
Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
name: clang-tidy-pr-comments
26

37
on:
@@ -7,46 +11,61 @@ on:
711
types:
812
- completed
913

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1018
jobs:
1119
clang-tidy-pr-comments:
12-
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
13-
runs-on: ubuntu-latest
20+
if: ${{ github.event.workflow_run.event == 'pull_request' && contains(fromJson('["success", "failure"]'), github.event.workflow_run.conclusion) }}
21+
runs-on: ubuntu-22.04
1422
steps:
1523
- name: Check out repository
1624
uses: actions/checkout@v4
1725

1826
- name: Download analysis results
1927
run: |
20-
gh run download ${{ github.event.workflow_run.id }} -D /tmp
28+
gh run download ${{ github.event.workflow_run.id }} -D /tmp || true
2129
env:
2230
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2331

32+
- name: Check if the fixes.yaml file exists
33+
id: check-fixes-yaml-existence
34+
uses: autowarefoundation/autoware-github-actions/check-file-existence@v1
35+
with:
36+
files: /tmp/clang-tidy-result/fixes.yaml
37+
2438
- name: Set variables
39+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
2540
id: set-variables
2641
run: |
27-
echo ::set-output name=pr-id::"$(cat /tmp/clang-tidy-result/pr-id.txt)"
28-
echo ::set-output name=pr-head-repo::"$(cat /tmp/clang-tidy-result/pr-head-repo.txt)"
29-
echo ::set-output name=pr-head-ref::"$(cat /tmp/clang-tidy-result/pr-head-ref.txt)"
42+
echo "pr-id=$(cat /tmp/clang-tidy-result/pr-id.txt)" >> $GITHUB_OUTPUT
43+
echo "pr-head-repo=$(cat /tmp/clang-tidy-result/pr-head-repo.txt)" >> $GITHUB_OUTPUT
44+
echo "pr-head-ref=$(cat /tmp/clang-tidy-result/pr-head-ref.txt)" >> $GITHUB_OUTPUT
3045
3146
- name: Check out PR head
47+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
3248
uses: actions/checkout@v4
3349
with:
3450
repository: ${{ steps.set-variables.outputs.pr-head-repo }}
3551
ref: ${{ steps.set-variables.outputs.pr-head-ref }}
3652
persist-credentials: false
3753

3854
- name: Replace paths in fixes.yaml
55+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
3956
run: |
4057
sed -i -e "s|/__w/|/home/runner/work/|g" /tmp/clang-tidy-result/fixes.yaml
4158
cat /tmp/clang-tidy-result/fixes.yaml
4259
4360
- name: Copy fixes.yaml to access from Docker Container Action
61+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
4462
run: |
4563
cp /tmp/clang-tidy-result/fixes.yaml fixes.yaml
4664
4765
- name: Run clang-tidy-pr-comments action
66+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
4867
uses: platisd/clang-tidy-pr-comments@v1
4968
with:
5069
github_token: ${{ secrets.GITHUB_TOKEN }}
5170
clang_tidy_fixes: fixes.yaml
52-
pull_request_id: ${{ steps.set-variables.outputs.pr-id }}
71+
pull_request_id: ${{ steps.set-variables.outputs.pr-id }}

.github/workflows/sync-files.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
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+
15
name: sync-files
26

37
on:
48
schedule:
59
- cron: 0 0 * * *
610
workflow_dispatch:
711

8-
jobs:
9-
check-secret:
10-
uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1
11-
secrets:
12-
secret: ${{ secrets.APP_ID }}
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
14+
cancel-in-progress: true
1315

16+
jobs:
1417
sync-files:
15-
needs: check-secret
16-
if: ${{ needs.check-secret.outputs.set == 'true' }}
17-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-22.04
1819
steps:
1920
- name: Generate token
2021
id: generate-token
@@ -28,6 +29,6 @@ jobs:
2829
with:
2930
token: ${{ steps.generate-token.outputs.token }}
3031
pr-labels: |
31-
bot
32-
sync-files
33-
auto-merge-method: squash
32+
tag:bot
33+
tag:sync-files
34+
auto-merge-method: squash

0 commit comments

Comments
 (0)