feat: add unit test before git push #361
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: API CI for New Pull Requests | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
project-directory: ./ | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
jobs: | |
test: | |
name: Run all tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- name: npm clean install | |
run: npm ci | |
- name: Typescript compiles | |
run: npm run build | |
- name: Eslint | |
run: npm run lint | |
- name: run tests | |
run: npm test | |
- name: run repository tests | |
run: npm run test-repository |