Skip to content

ci: adds linting and formatting jobs to on pull request workflow #355

ci: adds linting and formatting jobs to on pull request workflow

ci: adds linting and formatting jobs to on pull request workflow #355

name: Lint, Format, and Test
on:
workflow_call:
workflow_dispatch:
pull_request:
env:
API_KEY: ${{ secrets.API_KEY }}
APP_ID: ${{ secrets.APP_ID }}
APP_TOKEN: ${{ secrets.APP_TOKEN }}
EXAMPLE_USER_ID: ${{ secrets.EXAMPLE_USER_ID }}
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm i
- name: Lint
run: npm run lint:ci
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm i
- name: Format
run: |
if [[ $(npm run format:ci) ]]; then
echo "Run 'npm run format' to format code."
exit 1
fi
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm i
- name: Test
run: npm run test