From 4127c60d82fab7dc23eb14087dc632c0cd6e8a9f Mon Sep 17 00:00:00 2001 From: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Date: Mon, 21 Feb 2022 19:32:13 +0900 Subject: [PATCH] ci: add sync-files.yaml (#2) * ci: add sync-files.yaml Signed-off-by: Kenji Miyake * chore(config): add .pre-commit-config.yaml Signed-off-by: Kenji Miyake * chore: add build_depends.repos Signed-off-by: Kenji Miyake --- .github/sync-files.yaml | 24 ++++++++ .github/workflows/sync-files.yaml | 22 ++++++++ .pre-commit-config.yaml | 94 +++++++++++++++++++++++++++++++ build_depends.repos | 1 + 4 files changed, 141 insertions(+) create mode 100644 .github/sync-files.yaml create mode 100644 .github/workflows/sync-files.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 build_depends.repos diff --git a/.github/sync-files.yaml b/.github/sync-files.yaml new file mode 100644 index 0000000000..c6b9e8d4bd --- /dev/null +++ b/.github/sync-files.yaml @@ -0,0 +1,24 @@ +- repository: autowarefoundation/autoware + files: + - source: CODE_OF_CONDUCT.md + - source: CONTRIBUTING.md + - source: DISCLAIMER.md + - source: LICENSE + - source: .github/dependabot.yaml + - source: .github/workflows/pre-commit.yaml + - source: .github/workflows/pre-commit-optional.yaml + - source: .github/workflows/semantic-pull-request.yaml + - source: .github/workflows/spell-check-differential.yaml + - source: .markdown-link-check.json + - source: .markdownlint.yaml + - source: .pre-commit-config-optional.yaml + - source: .prettierignore + - source: .prettierrc.yaml + - source: .yamllint.yaml + - source: setup.cfg + +- repository: autowarefoundation/autoware_common + files: + - source: .github/workflows/build-and-test.yaml + - source: .github/workflows/build-and-test-differential.yaml + - source: .github/workflows/check-build-depends.yaml diff --git a/.github/workflows/sync-files.yaml b/.github/workflows/sync-files.yaml new file mode 100644 index 0000000000..0c5b4b04fa --- /dev/null +++ b/.github/workflows/sync-files.yaml @@ -0,0 +1,22 @@ +name: sync-files + +on: + schedule: + - cron: 0 19 * * * # run at 4 AM JST + workflow_dispatch: + +jobs: + sync-files: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Run sync-files + uses: autowarefoundation/autoware-github-actions/sync-files@tier4/proposal + with: + token: ${{ steps.generate-token.outputs.token }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..3dcb88f567 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,94 @@ +ci: + autofix_commit_msg: "ci(pre-commit): autofix" + autoupdate_commit_msg: "ci(pre-commit): autoupdate" + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: check-json + - id: check-merge-conflict + - id: check-toml + - id: check-xml + - id: check-yaml + - id: detect-private-key + - id: end-of-file-fixer + - id: mixed-line-ending + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.30.0 + hooks: + - id: markdownlint + args: [-c, .markdownlint.yaml, --fix] + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.5.1 + hooks: + - id: prettier + + - repo: https://github.com/adrienverge/yamllint + rev: v1.26.3 + hooks: + - id: yamllint + + - repo: https://github.com/tier4/pre-commit-hooks-ros + rev: v0.4.0 + hooks: + - id: prettier-xacro + - id: prettier-launch-xml + - id: prettier-package-xml + - id: sort-package-xml + + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.8.0.3 + hooks: + - id: shellcheck + + - repo: https://github.com/scop/pre-commit-shfmt + rev: v3.4.2-1 + hooks: + - id: shfmt + args: [-w, -s, -i=4] + + - repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + + - repo: https://github.com/psf/black + rev: 22.1.0 + hooks: + - id: black + args: [--line-length=100] + + - repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + additional_dependencies: + [ + flake8-blind-except, + flake8-builtins, + flake8-class-newline, + flake8-comprehensions, + flake8-deprecated, + flake8-docstrings, + flake8-import-order, + flake8-quotes, + ] + + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v13.0.0 + hooks: + - id: clang-format + + - repo: https://github.com/cpplint/cpplint + rev: 1.5.5 + hooks: + - id: cpplint + args: [--quiet] + exclude: .cu + +exclude: .svg diff --git a/build_depends.repos b/build_depends.repos new file mode 100644 index 0000000000..56f46b6f79 --- /dev/null +++ b/build_depends.repos @@ -0,0 +1 @@ +repositories: