Skip to content

Commit

Permalink
ci(contracts): add GitHub Action for CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
drichar committed Apr 16, 2024
1 parent 8bf1402 commit 325c1a2
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
65 changes: 65 additions & 0 deletions .github/workflows/ci-contracts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI Workflow (Contracts)

on:
push:
branches: [ dev, main ]
paths:
- 'contracts/**'
- '.github/workflows/ci-contracts.yaml'

pull_request:
branches: [ dev, main ]
paths:
- 'contracts/**'
- '.github/workflows/ci-contracts.yaml'

jobs:
run-ci:
if: "!contains(github.event.head_commit.message, 'chore: release v')"
name: Lint, Typecheck
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- 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@v4
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 dependencies
run: pnpm --filter ./contracts install

- name: Install dependencies (bootstrap)
run: pnpm --filter ./contracts/bootstrap install

- name: Lint
run: pnpm --filter ./contracts run lint

- name: Prettier
run: pnpm --filter ./contracts run prettier

- name: Typecheck (bootstrap)
run: pnpm --filter ./contracts/bootstrap run typecheck
3 changes: 2 additions & 1 deletion contracts/bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"build": "tsc",
"start": "node dist/bootstrap/index.js",
"bootstrap": "pnpm run build && pnpm run start"
"bootstrap": "pnpm run build && pnpm run start",
"typecheck": "tsc --noEmit"
},
"license": "MIT",
"dependencies": {
Expand Down

0 comments on commit 325c1a2

Please sign in to comment.