feat: Rewrite API in NestJS #26
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: Node API | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
setup: | |
name: Install Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
working-directory: ./api-node | |
run: yarn install --frozen-lockfile | |
build: | |
name: Build | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Restore cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
working-directory: ./api-node | |
run: yarn install --frozen-lockfile | |
- name: Build | |
working-directory: ./api-node | |
run: yarn build:ci | |
lint: | |
name: Lint | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Restore cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
working-directory: ./api-node | |
run: yarn install --frozen-lockfile | |
- name: Lint | |
working-directory: ./api-node | |
run: yarn lint | |
test: | |
name: Unit Tests | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Restore cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
working-directory: ./api-node | |
run: yarn install --frozen-lockfile | |
- name: Run unit tests | |
working-directory: ./api-node | |
run: yarn test | |
e2e-test: | |
name: E2E Tests | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Restore cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
working-directory: ./api-node | |
run: yarn install --frozen-lockfile | |
- name: Build Python API | |
working-directory: ./api-node | |
run: yarn python-api:build | |
- name: Build Node API | |
working-directory: ./api-node | |
run: yarn docker:build | |
- name: Run E2E tests | |
working-directory: ./api-node | |
run: yarn test:e2e:ci |