Skip to content

Commit

Permalink
ci: add build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
keenthekeen committed Oct 26, 2024
1 parent cdda366 commit 79745d7
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build

on:
pull_request:
types: [ opened, reopened ]
push:
branches:
- master

jobs:
js-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 20.x
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install JS Dependencies
run: pnpm install
- name: Build JS assets
run: pnpm build
25 changes: 25 additions & 0 deletions .github/workflows/prettier-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Prettier pull request

on:
pull_request:
branches: [main]

jobs:
prettier:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0

- name: Prettify code
uses: creyD/[email protected]
with:
# This part is also where you can pass other options, for example:
prettier_options: --write **/*.{js,md}
only_changed: True

0 comments on commit 79745d7

Please sign in to comment.