-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
111 additions
and
0 deletions.
There are no files selected for viewing
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
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 |