From db145d34623b633feb86e569b87026ed748026cb Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 22 Sep 2022 12:54:32 +0800 Subject: [PATCH] feat(workflows): sync with develop --- .github/workflows/ci-cd.yml | 40 ++++++++++++++++++++++++++++ .github/workflows/release-draft.yml | 4 +-- .github/workflows/release-nocodb.yml | 15 +++-------- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 5cfc98e157..5b9eb669a2 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -11,6 +11,7 @@ on: - "packages/nocodb/**" - ".github/workflows/ci-cd.yml" pull_request: + types: [ready_for_review] branches: [develop] paths: - "packages/nc-gui/**" @@ -635,3 +636,42 @@ jobs: name: cy-quick-pg-snapshots path: scripts/cypress/screenshots 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 \ No newline at end of file diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml index dcdfbbbdc3..dbcb3c9744 100644 --- a/.github/workflows/release-draft.yml +++ b/.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 # else HEAD will be taken 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 - TARGET_SHA=$(git rev-parse HEAD) + TARGET_SHA=$(git rev-list -n 1 HEAD | tail -1) fi echo "::set-output name=TARGET_SHA::${TARGET_SHA}" echo "Setting TARGET_SHA: ${TARGET_SHA}" diff --git a/.github/workflows/release-nocodb.yml b/.github/workflows/release-nocodb.yml index cf09af5b83..bffec27978 100644 --- a/.github/workflows/release-nocodb.yml +++ b/.github/workflows/release-nocodb.yml @@ -103,24 +103,17 @@ jobs: secrets: NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}" - # Close all issues with target tags 'Fixed' & 'Resolved' - close-fixed-issues: + # Close all issues with target tags 'Status: Ready for Next Release' + close-issues: needs: [release-docker, process-input] uses: ./.github/workflows/release-close-issue.yml with: - issue_label: 'Status: Fixed' - 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' + issue_label: 'Status: Ready for Next Release' version: ${{ needs.process-input.outputs.target_tag }} # Publish Docs publish-docs: - needs: close-resolved-issues + needs: close-issues uses: ./.github/workflows/publish-docs.yml secrets: GH_TOKEN: "${{ secrets.GH_TOKEN }}"