Github actions

This commit is contained in:
Jarred Sumner
2024-09-06 17:18:28 -07:00
parent e8c65a009f
commit 6fe2d99a51

View File

@@ -1,10 +1,10 @@
name: format
name: Format
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.run-id || github.ref }}
group: format-${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.run-id || github.ref }}
cancel-in-progress: true
on:
@@ -16,14 +16,49 @@ on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**.{ts,js,json,md,toml,yml,yaml,tsx,jsx,zig,cjs,mjs}"
- "**.{ts,js,json,md,toml,yml,yaml,tsx,jsx,zig,cjs,mjs,cpp,h,cc}"
jobs:
format:
name: Run format
uses: ./.github/workflows/run-format.yml
secrets: inherit
permissions:
contents: write
with:
zig-version: 0.13.0
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
.prettierrc-ci
.github
.vscode
src
scripts
packages
test
bench
package.json
bun.lockb
.clang-format
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: "1.1.25"
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0
- name: Install Dependencies
run: |
bun install
- name: Format
run: |
bun fmt
- name: Format Zig
run: |
bun fmt:zig
- name: Format Cpp
run: |
bun fmt:cpp
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply formatting changes