From 65102f30ac8ecb13528c2ff7aa1c0b4b97935e54 Mon Sep 17 00:00:00 2001 From: Angad Date: Wed, 13 Sep 2023 16:26:09 -0700 Subject: [PATCH] Fix workflows --- .../{format.yml => clang-format.yml} | 23 ++++++------- .github/workflows/prettier.yml | 32 +++++++++++++++++++ .github/workflows/testbuild.yml | 12 ++----- 3 files changed, 43 insertions(+), 24 deletions(-) rename .github/workflows/{format.yml => clang-format.yml} (70%) create mode 100644 .github/workflows/prettier.yml diff --git a/.github/workflows/format.yml b/.github/workflows/clang-format.yml similarity index 70% rename from .github/workflows/format.yml rename to .github/workflows/clang-format.yml index 2522323..4910095 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/clang-format.yml @@ -1,20 +1,15 @@ -name: Format +name: clang-format on: push: branches: main paths: - - "**.json" - - "**.yml" - repository_dispatch: - types: format-event + - "**.h" + - "**.cpp" workflow_dispatch: -permissions: - contents: write - jobs: - maintenance: + clang-format: runs-on: ubuntu-latest steps: - name: Checkout @@ -28,11 +23,6 @@ jobs: clangFormatVersion: 16 inplace: true - - name: Run Prettier - uses: actionsx/prettier@v3 - with: - args: --write "${{ github.workspace }}/*.json" - - name: Add & Commit uses: EndBug/add-and-commit@v9.1.3 with: @@ -40,3 +30,8 @@ jobs: default_author: github_actions env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v2.1.2 + with: + event-type: format-event diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 0000000..b03c13d --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,32 @@ +name: Prettier + +on: + push: + branches: main + paths: + - "**.json" + - "**.yml" + workflow_dispatch: + +permissions: + contents: write + +jobs: + prettier: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run Prettier + uses: actionsx/prettier@v3 + with: + args: --write "${{ github.workspace }}/*.json" + + - name: Add & Commit + uses: EndBug/add-and-commit@v9.1.3 + with: + message: "ci: formatting" + default_author: github_actions + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/testbuild.yml b/.github/workflows/testbuild.yml index c0ccc1c..02c701a 100644 --- a/.github/workflows/testbuild.yml +++ b/.github/workflows/testbuild.yml @@ -1,11 +1,8 @@ name: Test Build on: - push: - branches: main - paths: - - "**.h" - - "**.cpp" + repository_dispatch: + types: format-event workflow_dispatch: env: @@ -36,8 +33,3 @@ jobs: with: configurePreset: build-${{ matrix.preset }}-msvc buildPreset: ${{ matrix.preset }}-msvc - - - name: Repository Dispatch - uses: peter-evans/repository-dispatch@v2.1.2 - with: - event-type: format-event