Browse Source

refactor(workflows): simplify workflow & use pnpm store

pull/5903/head
Wing-Kam Wong 1 year ago
parent
commit
e37099369d
  1. 61
      .github/workflows/ci-cd.yml
  2. 12
      .github/workflows/playwright-test-workflow.yml
  3. 20
      .github/workflows/release-executables.yml
  4. 24
      .github/workflows/release-timely-executables.yml
  5. 13
      .github/workflows/unit-test.yml
  6. 6
      .github/workflows/update-sdk-path.yml

61
.github/workflows/ci-cd.yml

@ -45,28 +45,20 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
# pnpm cache files are stored in `~/.pnpm` on Linux/macOS
path: ~/.pnpm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install dependencies nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: pnpm install
- name: build nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: pnpm run build:main
${{ runner.os }}-pnpm-store-
- name: Install dependencies for packages
run: pnpm bootstrap
- name: Install dependencies
working-directory: ./packages/nocodb
run: pnpm install
- name: run unit tests
working-directory: ./packages/nocodb
run: pnpm run test:unit
@ -87,19 +79,17 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
# pnpm cache files are stored in `~/.pnpm` on Linux/macOS
path: ~/.pnpm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
${{ runner.os }}-pnpm-store-
- name: Set CI env
run: export CI=true
- name: Set NC Edition
@ -107,15 +97,8 @@ jobs:
- name: setup pg
working-directory: ./
run: docker-compose -f ./tests/playwright/scripts/docker-compose-playwright-pg.yml up -d &
- name: install dependencies nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: pnpm install
- name: build nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: pnpm run build:main
- name: Install dependencies
working-directory: ./packages/nocodb
run: pnpm install
- name: install dependencies
run: pnpm bootstrap
- name: run unit tests
working-directory: ./packages/nocodb
run: pnpm run test:unit:pg

12
.github/workflows/playwright-test-workflow.yml

@ -57,12 +57,8 @@ jobs:
run: export CI=true
- name: Set NC Edition
run: export EE=true
- name: install dependencies nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: pnpm install
- name: Build nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: pnpm run build
- name: install dependencies
run: pnpm bootstrap
- name: Setup mysql
if: ${{ inputs.db == 'mysql' }}
working-directory: ./packages/nocodb/tests/mysql-sakila-db
@ -90,24 +86,20 @@ jobs:
if: ${{ inputs.db == 'sqlite' }}
working-directory: ./packages/nocodb
run: |
pnpm install
pnpm run watch:run:playwright &> ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log &
- name: Run backend:mysql
if: ${{ inputs.db == 'mysql' }}
working-directory: ./packages/nocodb
run: |
pnpm install
pnpm run watch:run:playwright:mysql &> ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log &
- name: Run backend:pg
if: ${{ inputs.db == 'pg' }}
working-directory: ./packages/nocodb
run: |
pnpm install
pnpm run watch:run:playwright:pg &> ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log &
- name: Install dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ./tests/playwright
run: pnpm install
- name: Install Playwright Browsers
working-directory: ./tests/playwright
run: pnpm exec playwright install --with-deps chromium

20
.github/workflows/release-executables.yml

@ -22,19 +22,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
${{ runner.os }}-pnpm-store-
- name: Cache pkg modules
id: cache-pkg

24
.github/workflows/release-timely-executables.yml

@ -29,19 +29,17 @@ jobs:
with:
token: ${{ secrets.NC_GITHUB_TOKEN }}
repository: 'nocodb/nocodb-timely'
- name: Cache node modules
id: cache-pnpm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
# pnpm cache files are stored in `~/.pnpm` on Linux/macOS
path: ~/.pnpm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
${{ runner.os }}-pnpm-store-
- name: Cache pkg modules
id: cache-pkg
uses: actions/cache@v3
@ -68,7 +66,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Update nocodb-timely
env:
@ -86,7 +84,7 @@ jobs:
- name : Install dependencies and build executables
run: |
# install pnpm dependendencies
pnpm i
pnpm bootstrap
# Copy sqlite binaries
# rsync -rvzhP ./binaries/binding/ ./node_modules/sqlite3/lib/binding/

13
.github/workflows/unit-test.yml

@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
@ -34,15 +34,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: install dependencies nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: pnpm install --frozen-lockfile
- name: build nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: pnpm run build:main
- name: install dependencies nocodb
working-directory: ./packages/nocodb
run: pnpm install --frozen-lockfile
- name: install dependencies
run: pnpm bootstrap
- name: run unit tests
working-directory: ./packages/nocodb
run: pnpm run unit-test

6
.github/workflows/update-sdk-path.yml

@ -23,11 +23,7 @@ jobs:
fetch-depth: 0
- run: |
cd packages/nocodb
pnpm install --ignore-scripts nocodb-sdk
cd ../..
cd packages/nc-gui
pnpm install --ignore-scripts nocodb-sdk
pnpm bootstrap
- name: Create Pull Request
id: cpr

Loading…
Cancel
Save