Add linting step within GitHub Actions workflow #64
Workflow file for this run
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: CI | |
on: [pull_request] | |
jobs: | |
server-unit-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [21.x] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: npm install | |
working-directory: server/ | |
- name: Compile TypeScript files | |
run: npx tsc | |
working-directory: server/ | |
- name: Run server tests | |
run: npm test | |
working-directory: server/ | |
lint-server: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [21.x] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: npm install | |
working-directory: server/ | |
- name: Lint server-side code | |
run: npm run lint:fix | |
working-directory: server/ | |
lint-client: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [21.x] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: npm install | |
working-directory: client/ | |
- name: Lint client-side code | |
run: npm run lint:fix | |
working-directory: client/ | |
file-existence-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Check for sensitive files | |
run: | | |
if [ -e ".env" ] || [ -e "firebase-secret.json" ]; then | |
echo "Error: Found .env or firebase-secret.json in the pull request. Please remove them before merging."; | |
exit 1; | |
fi |