ci: adds linting and formatting jobs to on pull request workflow #355
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |