Skip to content

Commit

Permalink
add ci for node api
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 committed Oct 16, 2024
1 parent 8113667 commit eaeb933
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/node-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Node API CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
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: 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:
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

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:
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:
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 e2e tests
working-directory: ./api-node
run: yarn test:e2e

0 comments on commit eaeb933

Please sign in to comment.