Skip to content

Commit

Permalink
Update node.js.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yutianqaq committed Jan 16, 2024
1 parent 3c0e35f commit de03086
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
name: CI
on: [push]

jobs:
build:

name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

strategy:
matrix:
node-version: [14.21.3]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: yarn install
- run: yarn build --if-present
- run: yarn test
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # if needed
- name: Build production bundle
uses: borales/actions-yarn@v4
with:
cmd: build:prod # will run `yarn build:prod` command
- name: Test the app
uses: borales/actions-yarn@v4
with:
cmd: test # will run `yarn test` command

- name: Run test in sub-folder
uses: borales/actions-yarn@v4
with:
cmd: test
dir: 'frontend' # will run `yarn test` in `frontend` sub folder

0 comments on commit de03086

Please sign in to comment.