Github Commit/PR check
note
This feature is available both in local app and at app.crusher.dev
Link your github repo
We require you to link your github repo to your Crusher project,
- Go to Project settings -> Integration
- Click connect in github integration
- Select your github repo
Setup github actions
- Next.js
- React
- Vue.js
Using vercel deployments?
Checkout: Integration with Vercel/Netlify
name: Running tests for Next.js
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: Install node modules
run: npm i
- name: Build app
run: npm run build
- name: Run tests
run: npx crusher.dev test:run --pre-run="npm run start" --token="<crusher_token>"
name: Running tests for React
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: Install node modules
run: npm i
- name: Run tests
run: npx crusher.dev test:run --pre-run="npm run start" --token="<crusher_token>"
name: Running tests for Vue.js
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: Install node modules
run: npm i
- name: Build app
run: npm run build
- name: Run tests
run: npx crusher.dev test:run --pre-run="npm run serve" --token="<crusher_token>"
- Copy the above code and paste it in your github actions file. You can find the file in your repo at
.github/workflows/crusher.yml
- Replace
<crusher_token>
with your crusher token. You can get it by runningnpx crusher.dev token
from your terminal
Checks on commit & PR
Create a pull request and to see Crusher in action