From 61f03bd9ce2bda3a43e404c8395475bd330b4242 Mon Sep 17 00:00:00 2001 From: Bas Date: Sat, 23 Nov 2024 21:51:04 +0100 Subject: [PATCH] Install all packages in github ci flows --- .github/workflows/ci.yml | 17 ++++++++--------- package.json | 9 ++++++++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1a2bfe..7a8049a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,38 +10,37 @@ on: - main jobs: - build: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - - run: npm ci --prefer-offline --no-audit --no-save - - run: npm run build # includes linting + - run: npm run ci:all + - run: npm run build:prod + - run: npm run lint test: - needs: build + needs: lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - - run: npm ci --prefer-offline --no-audit --no-save - - run: npm run install:test-setup + - run: npm run ci:all - run: npm run build - run: npm run test examples: - needs: build + needs: lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - - run: npm ci --prefer-offline --no-audit --no-save - - run: npm run install:examples + - run: npm run ci:all - run: npm run build - run: npm run build:examples diff --git a/package.json b/package.json index eeb9b86..a5e671f 100644 --- a/package.json +++ b/package.json @@ -30,17 +30,24 @@ "scripts": { "start": "npm run watch", "watch": "nodemon --watch ./src --ext js,ts --exec \"npm run build:dev\"", - "build": "npm run clean && rollup --config rollup.config.js --environment BUILD:production && npm run lint", + + "build": "npm run build:prod && npm run lint", "build:dev": "npm run clean && rollup --config rollup.config.js", + "build:prod": "npm run clean && rollup --config rollup.config.js --environment BUILD:production", "build:examples": "npm run for:examples --action=\"run build\"", + "install:examples": "npm run for:examples --action=\"install --prefer-offline\"", "install:test-setup": "npm install --prefix ./tests/package/project --prefer-offline", "install:all": "npm run for:all --action=\"install --prefer-offline\"", + "ci:all": "npm run for:all --action=\"ci --prefer-offline --no-audit --no-save\"", + "lint": "eslint", "test": "nyc ava", + "version:prerelease": "npm version prerelease --preid=prerelease", "publish:local": "npm run build && npm install --global", "publish:prerelease": "npm run build && release-it --prerelease=prerelease", + "clean": "node --eval \"fs.rmSync('./dist', { recursive: true, force: true })\"", "exec": "node --eval \"var t=process.env.npm_config_target;child_process.execSync('npm '+process.env.npm_config_action+(t?(' --prefix '+t):''),{stdio: 'inherit'})\"", "for:examples": "npm run exec --target=examples/AllWidgets && npm run exec --target=examples/BirdStalker && npm run exec --target=examples/Ratios && npm run exec --target=examples/WindowWithTabs",