Skip to content

Commit c4de6eb

Browse files
committed
Add missing files
1 parent 5c32ea8 commit c4de6eb

21 files changed

+747
-0
lines changed

.clang-format

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Modified from https://github.com/ament/ament_lint/blob/master/ament_clang_format/ament_clang_format/configuration/.clang-format
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
5+
AccessModifierOffset: -2
6+
AlignAfterOpenBracket: AlwaysBreak
7+
AllowShortFunctionsOnASingleLine: InlineOnly
8+
BraceWrapping:
9+
AfterClass: true
10+
AfterFunction: true
11+
AfterNamespace: true
12+
AfterStruct: true
13+
BreakBeforeBraces: Custom
14+
ColumnLimit: 100
15+
ConstructorInitializerIndentWidth: 0
16+
ContinuationIndentWidth: 2
17+
DerivePointerAlignment: false
18+
PointerAlignment: Middle
19+
ReflowComments: true
20+
IncludeCategories:
21+
# C++ system headers
22+
- Regex: <[a-z_]*>
23+
Priority: 6
24+
CaseSensitive: true
25+
# C system headers
26+
- Regex: <.*\.h>
27+
Priority: 5
28+
CaseSensitive: true
29+
# Boost headers
30+
- Regex: boost/.*
31+
Priority: 4
32+
CaseSensitive: true
33+
# Message headers
34+
- Regex: .*_msgs/.*
35+
Priority: 3
36+
CaseSensitive: true
37+
- Regex: .*_srvs/.*
38+
Priority: 3
39+
CaseSensitive: true
40+
# Other Package headers
41+
- Regex: <.*>
42+
Priority: 2
43+
CaseSensitive: true
44+
# Local package headers
45+
- Regex: '".*"'
46+
Priority: 1
47+
CaseSensitive: true

.github/dependabot.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 1
8+
labels:
9+
- bot
10+
- github-actions

.github/sync-files.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- repository: autowarefoundation/autoware
2+
files:
3+
- source: .github/dependabot.yaml
4+
- source: .github/workflows/github-release.yaml
5+
- source: .github/workflows/pre-commit.yaml
6+
- source: .github/workflows/pre-commit-optional.yaml
7+
- source: .github/workflows/semantic-pull-request.yaml
8+
- source: .github/workflows/spell-check-differential.yaml
9+
- source: .github/workflows/sync-files.yaml
10+
- source: .clang-format
11+
- source: .markdown-link-check.json
12+
- source: .markdownlint.yaml
13+
- source: .pre-commit-config-optional.yaml
14+
- source: .prettierignore
15+
- source: .prettierrc.yaml
16+
- source: .yamllint.yaml

.github/workflows/github-release.yaml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: github-release
2+
3+
on:
4+
push:
5+
branches:
6+
- beta/v*
7+
tags:
8+
- v*
9+
workflow_dispatch:
10+
inputs:
11+
beta-branch-or-tag-name:
12+
description: The name of the beta branch or tag to release
13+
type: string
14+
required: true
15+
16+
jobs:
17+
github-release:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Set tag name
21+
id: set-tag-name
22+
run: |
23+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
24+
REF_NAME="${{ github.event.inputs.beta-branch-or-tag-name }}"
25+
else
26+
REF_NAME="${{ github.ref_name }}"
27+
fi
28+
29+
echo "ref-name=$REF_NAME" >> $GITHUB_OUTPUT
30+
echo "tag-name=${REF_NAME#beta/}" >> $GITHUB_OUTPUT
31+
32+
- name: Check out repository
33+
uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 0
36+
ref: ${{ steps.set-tag-name.outputs.ref-name }}
37+
38+
- name: Set target name for beta branches
39+
id: set-target-name
40+
run: |
41+
if [[ "${{ steps.set-tag-name.outputs.ref-name }}" =~ "beta/" ]]; then
42+
echo "target-name=${{ steps.set-tag-name.outputs.ref-name }}" >> $GITHUB_OUTPUT
43+
fi
44+
45+
- name: Create a local tag for beta branches
46+
run: |
47+
if [ "${{ steps.set-target-name.outputs.target-name }}" != "" ]; then
48+
git tag "${{ steps.set-tag-name.outputs.tag-name }}"
49+
fi
50+
51+
- name: Run generate-changelog
52+
id: generate-changelog
53+
uses: autowarefoundation/autoware-github-actions/generate-changelog@v1
54+
55+
- name: Select verb
56+
id: select-verb
57+
run: |
58+
has_previous_draft=$(gh release view --json isDraft -q ".isDraft" "${{ steps.set-tag-name.outputs.tag-name }}") || true
59+
60+
verb=create
61+
if [ "$has_previous_draft" = "true" ]; then
62+
verb=edit
63+
fi
64+
65+
echo "verb=$verb" >> $GITHUB_OUTPUT
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
69+
- name: Release to GitHub
70+
run: |
71+
gh release ${{ steps.select-verb.outputs.verb }} "${{ steps.set-tag-name.outputs.tag-name }}" \
72+
--draft \
73+
--target "${{ steps.set-target-name.outputs.target-name }}" \
74+
--title "Release ${{ steps.set-tag-name.outputs.tag-name }}" \
75+
--notes "$NOTES"
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
NOTES: ${{ steps.generate-changelog.outputs.changelog }}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: pre-commit-optional
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pre-commit-optional:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out repository
11+
uses: actions/checkout@v3
12+
13+
- name: Run pre-commit
14+
uses: autowarefoundation/autoware-github-actions/pre-commit@v1
15+
with:
16+
pre-commit-config: .pre-commit-config-optional.yaml

.github/workflows/pre-commit.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pre-commit:
8+
if: ${{ github.event.repository.private }} # Use pre-commit.ci for public repositories
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Generate token
12+
id: generate-token
13+
uses: tibdex/github-app-token@v1
14+
with:
15+
app_id: ${{ secrets.APP_ID }}
16+
private_key: ${{ secrets.PRIVATE_KEY }}
17+
18+
- name: Check out repository
19+
uses: actions/checkout@v3
20+
with:
21+
ref: ${{ github.event.pull_request.head.ref }}
22+
23+
- name: Run pre-commit
24+
uses: autowarefoundation/autoware-github-actions/pre-commit@v1
25+
with:
26+
pre-commit-config: .pre-commit-config.yaml
27+
token: ${{ steps.generate-token.outputs.token }}

.github/workflows/pytest.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: pytest
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pytest:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out repository
11+
uses: actions/checkout@v3
12+
13+
- name: Install dependent packages
14+
run: python3 -m pip install -r requirements.txt
15+
16+
- name: Run pytest
17+
run: python3 -m pytest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: semantic-pull-request
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
semantic-pull-request:
12+
uses: autowarefoundation/autoware-github-actions/.github/workflows/semantic-pull-request.yaml@v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: spell-check-differential
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
spell-check-differential:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out repository
11+
uses: actions/checkout@v3
12+
13+
- name: Run spell-check
14+
uses: autowarefoundation/autoware-github-actions/spell-check@v1
15+
with:
16+
cspell-json-url: https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/.cspell.json

.github/workflows/sync-files.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: sync-files
2+
3+
on:
4+
schedule:
5+
- cron: 0 0 * * *
6+
workflow_dispatch:
7+
8+
jobs:
9+
check-secret:
10+
uses: autowarefoundation/autoware-github-actions/.github/workflows/check-secret.yaml@v1
11+
secrets:
12+
secret: ${{ secrets.APP_ID }}
13+
14+
sync-files:
15+
needs: check-secret
16+
if: ${{ needs.check-secret.outputs.set == 'true' }}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Generate token
20+
id: generate-token
21+
uses: tibdex/github-app-token@v1
22+
with:
23+
app_id: ${{ secrets.APP_ID }}
24+
private_key: ${{ secrets.PRIVATE_KEY }}
25+
26+
- name: Run sync-files
27+
uses: autowarefoundation/autoware-github-actions/sync-files@v1
28+
with:
29+
token: ${{ steps.generate-token.outputs.token }}
30+
pr-labels: |
31+
bot
32+
sync-files
33+
auto-merge-method: squash
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: test-pre-commit-hooks
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
test-pre-commit-hooks:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out repository
11+
uses: actions/checkout@v3
12+
13+
- name: Run pre-commit
14+
uses: autowarefoundation/autoware-github-actions/pre-commit@v1
15+
with:
16+
pre-commit-config: tests/pre-commit-hooks/test-pre-commit-hooks.yaml
17+
18+
- name: Try pre-commit
19+
run: |
20+
pre-commit try-repo https://github.com/tier4/pre-commit-hooks-ros flake8-ros -a --ref ${{ github.ref }}
21+
22+
- name: Try pre-commit with fault injected
23+
run: |
24+
echo "import os" >> pre_commit_hooks/sort_package_xml.py
25+
if pre-commit try-repo https://github.com/tier4/pre-commit-hooks-ros flake8-ros -a --ref ${{ github.ref }}; then
26+
exit 1
27+
fi

0 commit comments

Comments
 (0)