Skip to content

Commit

Permalink
add ci.yml (#149)
Browse files Browse the repository at this point in the history
* add ci.yml

* configure ref and repository

* use node v22

* add .prettierignore

* update ci.yml

* add package-lock

* add scripts to run prettier locally

* format not all files
  • Loading branch information
koilebeit authored Aug 15, 2024
1 parent 0b5ca43 commit b7e437c
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Continuous Integration

on:
pull_request:
branches: [main]

jobs:
prettier:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22' # Specify the Node.js version you want

- name: Install Dependencies
run: npm ci # Using npm ci for a clean install based on package-lock.json

- name: Check Formatting
run: npx prettier --check "**/*.{js,css,md,html}"
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_data/**
_plugins/**
_site/**
assets/**
objects/**
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["@shopify/prettier-plugin-liquid"],
"overrides": [
{
"files": "*.html",
"options": {
"parser": "liquid-html"
}
}
]
}
94 changes: 94 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"scripts": {
"check": "prettier --check '**/*.{js,css,md,html}'",
"format": "prettier --write '**/*.{js,css,md,html}'"
},
"dependencies": {
"prettier": "^3.3.3",
"@shopify/prettier-plugin-liquid": "^1.5.0"
}
}

0 comments on commit b7e437c

Please sign in to comment.