Skip to content

use tsup and create monorepo structure #114

use tsup and create monorepo structure

use tsup and create monorepo structure #114

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
strategy:
matrix:
node-version: [20.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.0.0
- run: npm install
- run: npm run build
- name: Cache dependencies
uses: actions/cache/save@v3
with:
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: node_modules
- name: Cache build artifacts
uses: actions/cache/save@v3
with:
key: dist-${{ hashFiles('**/dist/**') }}
path: dist
test-new:
needs: build
strategy:
matrix:
node-version: [19.x, 20.x]
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Restore dependencies
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: node_modules
- name: Restore build artifacts
uses: actions/cache/restore@v3
with:
key: dist-${{ hashFiles('**/dist/**') }}
path: dist
- run: npm test
test:
needs: build
strategy:
matrix:
node-version: [16.x, 18.x]
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: nodejs
run: node --version
# Runs a set of commands using the runners shell
- name: Restore dependencies
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: node_modules
- name: Restore build artifacts
uses: actions/cache/restore@v3
with:
path: dist
key: dist-${{ hashFiles('**/dist/**') }}
- run: npm test
test-legacy:
needs: build
strategy:
matrix:
node-version: [14.x]
os: [
# ubuntu-18.04,
ubuntu-20.04,
ubuntu-latest,
macos-latest,
windows-latest,
]
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: nodejs
run: node --version
- name: nodejs
run: node --version
- name: Restore dependencies
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
path: node_modules
- name: Restore build artifacts
uses: actions/cache/restore@v3
with:
path: dist
key: dist-${{ hashFiles('**/dist/**') }}
- run: npm test