From 34ba65c214cd31b033ef3d2bb4c8a8d828a7690e Mon Sep 17 00:00:00 2001 From: Rocky14683 Date: Wed, 20 Mar 2024 21:21:04 -0400 Subject: [PATCH] commit actions --- .github/workflows/build-project.yml | 29 ++++++++++++++++++++ .github/workflows/clang-format.yml | 41 ++++++++++++++--------------- .github/workflows/clang-tidy.yml | 28 ++++++++++++++++++++ 3 files changed, 77 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/build-project.yml create mode 100644 .github/workflows/clang-tidy.yml diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml new file mode 100644 index 0000000..12d7b01 --- /dev/null +++ b/.github/workflows/build-project.yml @@ -0,0 +1,29 @@ +name: Build Project + +on: + push: + branches: [master] + pull_request: + types: [review_requested, ready_for_review, synchronize] + +jobs: + build: + if: github.event.pull_request.requested_reviewers[0] != null + runs-on: ubuntu-latest + steps: + - name: Install ARM Toolchain + uses: carlosperate/arm-none-eabi-gcc-action@v1.8.1 + with: + release: "10.3-2021.10" + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.9 + - run: pip install pros-cli + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + - name: Build Project + run: pros make clean all \ No newline at end of file diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 15f8f74..5801280 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,29 +1,28 @@ name: Clang Format on: - push: - branches: - - 'master' pull_request: - types: [review_requested, ready_for_review] + types: + - closed jobs: - build: + format: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.ref }} - - name: Format - uses: DoozyX/clang-format-lint-action@v0.16.2 - with: - source: './src ./include/VOSS' - clangFormatVersion: 14 - inplace: True - - name: Commit - uses: EndBug/add-and-commit@v9 - with: - default_author: github_actions - message: 'Committing clang-format changes' + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + - name: Format + uses: DoozyX/clang-format-lint-action@v0.16.2 + with: + source: './src ./include/VOSS' + clangFormatVersion: 14 + inplace: True + - name: Commit + uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + message: 'Committing clang-format changes' \ No newline at end of file diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml new file mode 100644 index 0000000..105dbbc --- /dev/null +++ b/.github/workflows/clang-tidy.yml @@ -0,0 +1,28 @@ +name: Clang Tidy + +on: + - review_requested + - ready_for_review + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install ARM Toolchain + uses: carlosperate/arm-none-eabi-gcc-action@v1.8.1 + with: + release: "10.3-2021.10" + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.9 + - run: pip install pros-cli + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + - name: Build Project + run: pros build-compile-commands + - name: Run clang-tidy + uses: ZedThree/clang-tidy-review@v0.14.0 \ No newline at end of file