From 53a34c30b8f4f0e276cf1b927a4d9481d037f1be Mon Sep 17 00:00:00 2001 From: Li Bo Date: Tue, 12 Dec 2023 17:20:11 +0800 Subject: [PATCH] ci: gitlab add dangerjs pre-check --- .github/workflows/dangerjs.yml | 22 ++++++++++++++++++++++ .gitlab-ci.yml | 12 +----------- .gitlab/ci/danger.yml | 10 ++++++++++ 3 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/dangerjs.yml create mode 100644 .gitlab/ci/danger.yml diff --git a/.github/workflows/dangerjs.yml b/.github/workflows/dangerjs.yml new file mode 100644 index 000000000..e6d4d7db6 --- /dev/null +++ b/.github/workflows/dangerjs.yml @@ -0,0 +1,22 @@ +name: DangerJS Pull Request linter +on: + pull_request_target: + types: [opened, edited, reopened, synchronize] + +permissions: + pull-requests: write + contents: write + +jobs: + pull-request-style-linter: + runs-on: ubuntu-latest + steps: + - name: Check out PR head + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: DangerJS pull request linter + uses: espressif/shared-github-dangerjs@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 739469677..506a109e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,18 +23,8 @@ workflow: variables: IOT_SOLUTION_PATH: "$CI_PROJECT_DIR" -before_script: - # add gitlab ssh key - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64 - - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config - - git --version - - git submodule update --init --recursive - include: + - '.gitlab/ci/danger.yml' - '.gitlab/ci/rules.yml' - '.gitlab/ci/pre_check.yml' - '.gitlab/ci/build.yml' diff --git a/.gitlab/ci/danger.yml b/.gitlab/ci/danger.yml new file mode 100644 index 000000000..c9db61b68 --- /dev/null +++ b/.gitlab/ci/danger.yml @@ -0,0 +1,10 @@ +# Extenal DangerJS +include: + - project: espressif/shared-ci-dangerjs + ref: master + file: danger.yaml + +run-danger-mr-linter: + stage: pre_check + tags: + - dangerjs