Skip to content

Commit

Permalink
ci: move to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Jul 8, 2024
1 parent 33d32bd commit 7b04f6e
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 80 deletions.
77 changes: 0 additions & 77 deletions .circleci/config.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Setup
description: Setup Node.js and install dependencies

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
shell: bash
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Lint files
run: yarn lint

- name: Typecheck files
run: yarn typecheck

test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage

- name: Upload test coverage
run: yarn codecov

- name: Store test coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"scripts": {
"test": "jest",
"lint": "eslint .",
"typescript": "tsc --noEmit",
"typecheck": "tsc --noEmit",
"release": "release-it"
},
"publishConfig": {
Expand Down Expand Up @@ -61,7 +61,8 @@
},
"husky": {
"hooks": {
"pre-commit": "yarn lint && yarn typescript && yarn test"
"pre-commit": "yarn lint && yarn typecheck && yarn test"
}
}
},
"packageManager": "[email protected]"
}

0 comments on commit 7b04f6e

Please sign in to comment.