Browse Source

feat(workflows): sync with develop

pull/3759/head
Wing-Kam Wong 2 years ago
parent
commit
db145d3462
  1. 40
      .github/workflows/ci-cd.yml
  2. 4
      .github/workflows/release-draft.yml
  3. 15
      .github/workflows/release-nocodb.yml

40
.github/workflows/ci-cd.yml

@ -11,6 +11,7 @@ on:
- "packages/nocodb/**" - "packages/nocodb/**"
- ".github/workflows/ci-cd.yml" - ".github/workflows/ci-cd.yml"
pull_request: pull_request:
types: [ready_for_review]
branches: [develop] branches: [develop]
paths: paths:
- "packages/nc-gui/**" - "packages/nc-gui/**"
@ -635,3 +636,42 @@ jobs:
name: cy-quick-pg-snapshots name: cy-quick-pg-snapshots
path: scripts/cypress/screenshots path: scripts/cypress/screenshots
retention-days: 2 retention-days: 2
unit-tests:
runs-on: ubuntu-20.04
steps:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16.15.0
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install dependencies nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: npm install
- name: build nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: npm run build:main
- name: Install dependencies
working-directory: ./packages/nocodb
run: npm install
- name: setup mysql
working-directory: ./
run: docker-compose -f ./scripts/docker-compose-cypress.yml up -d
- name: run unit tests
working-directory: ./packages/nocodb
run: npm run test:unit

4
.github/workflows/release-draft.yml

@ -49,9 +49,9 @@ jobs:
# the SHA from the third commit (i.e. Auto PR from master to develop) will be taken # the SHA from the third commit (i.e. Auto PR from master to develop) will be taken
# else HEAD will be taken # else HEAD will be taken
run: | run: |
TARGET_SHA=$(git rev-parse HEAD~2) TARGET_SHA=$(git rev-list -n 3 HEAD | tail -1)
if [[ ${{ github.event.inputs.tagHeadSHA || inputs.tagHeadSHA }} == "Y" ]]; then if [[ ${{ github.event.inputs.tagHeadSHA || inputs.tagHeadSHA }} == "Y" ]]; then
TARGET_SHA=$(git rev-parse HEAD) TARGET_SHA=$(git rev-list -n 1 HEAD | tail -1)
fi fi
echo "::set-output name=TARGET_SHA::${TARGET_SHA}" echo "::set-output name=TARGET_SHA::${TARGET_SHA}"
echo "Setting TARGET_SHA: ${TARGET_SHA}" echo "Setting TARGET_SHA: ${TARGET_SHA}"

15
.github/workflows/release-nocodb.yml

@ -103,24 +103,17 @@ jobs:
secrets: secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}" NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
# Close all issues with target tags 'Fixed' & 'Resolved' # Close all issues with target tags 'Status: Ready for Next Release'
close-fixed-issues: close-issues:
needs: [release-docker, process-input] needs: [release-docker, process-input]
uses: ./.github/workflows/release-close-issue.yml uses: ./.github/workflows/release-close-issue.yml
with: with:
issue_label: 'Status: Fixed' issue_label: 'Status: Ready for Next Release'
version: ${{ needs.process-input.outputs.target_tag }}
close-resolved-issues:
needs: [close-fixed-issues, process-input]
uses: ./.github/workflows/release-close-issue.yml
with:
issue_label: 'Status: Resolved'
version: ${{ needs.process-input.outputs.target_tag }} version: ${{ needs.process-input.outputs.target_tag }}
# Publish Docs # Publish Docs
publish-docs: publish-docs:
needs: close-resolved-issues needs: close-issues
uses: ./.github/workflows/publish-docs.yml uses: ./.github/workflows/publish-docs.yml
secrets: secrets:
GH_TOKEN: "${{ secrets.GH_TOKEN }}" GH_TOKEN: "${{ secrets.GH_TOKEN }}"

Loading…
Cancel
Save