From 58565ac910c0e323a9a23bd12095efa16e4638de Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Thu, 14 Mar 2024 13:24:06 +0530 Subject: [PATCH] disable other checks --- .github/workflows/a11y.yaml | 79 ---------- .github/workflows/catalog.yaml | 155 ------------------- .github/workflows/cross-repo.yaml | 241 ------------------------------ .github/workflows/crowdin.yaml | 59 -------- .github/workflows/ftest.yaml | 165 -------------------- .github/workflows/lint.yaml | 42 ------ .github/workflows/main.yaml | 147 ------------------ .github/workflows/preview.yaml | 197 ------------------------ .github/workflows/promote.yaml | 164 -------------------- .github/workflows/test.yaml | 48 ------ .github/workflows/veracode.yml | 5 +- 11 files changed, 4 insertions(+), 1298 deletions(-) diff --git a/.github/workflows/a11y.yaml b/.github/workflows/a11y.yaml index f7b058ec7f..e69de29bb2 100644 --- a/.github/workflows/a11y.yaml +++ b/.github/workflows/a11y.yaml @@ -1,79 +0,0 @@ -name: A11y - -on: - pull_request: - branches: - - maintenance-3.0.x - workflow_call: - inputs: - branch: - description: 'The current branch' - default: maintenance-3.0.x - type: string - required: false - secrets: - NPM_PACKAGES_TOKEN: - description: 'NPM_PACKAGES_TOKEN' - required: true - PACKAGES_AUTH_USER: - description: 'PACKAGES_AUTH_USER' - required: true - PACKAGES_AUTH_TOKEN: - description: 'PACKAGES_AUTH_TOKEN' - required: true - -env: - REFERENCE_BRANCH: maintenance-3.0.x - NPM_REPOSITORY: https://packages.nuxeo.com/repository/npm-public/ - BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'maintenance-3.0.x' }} - -jobs: - a11y: - runs-on: [self-hosted, master] - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ env.BRANCH_NAME }} - - - run: git config user.name "nuxeo-webui-jx-bot" && git config user.email "webui@hyland.com" - - - uses: actions/setup-node@v3 - with: - registry-url: ${{ env.NPM_REPOSITORY }} - node-version: 18 - scope: '@nuxeo' - - - name: Install Web UI - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} - run: | - npm install - pushd packages/nuxeo-web-ui-ftest - npm install - popd - pushd packages/nuxeo-designer-catalog - npm install - popd - - - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: '11' - - - name: 'Update settings.xml with server configuration' - run: | - echo ' - - - maven-internal - ${{ secrets.PACKAGES_AUTH_USER }} - ${{ secrets.PACKAGES_AUTH_TOKEN }} - - - ' > ~/.m2/settings.xml - - - name: Web UI build - run: mvn -B -ntp install - - - name: A11y checks - run: mvn -B -ntp -f plugin/a11y install diff --git a/.github/workflows/catalog.yaml b/.github/workflows/catalog.yaml index 77e0756c3d..e69de29bb2 100644 --- a/.github/workflows/catalog.yaml +++ b/.github/workflows/catalog.yaml @@ -1,155 +0,0 @@ -# This workflow generates a new version of the catalog used by Nuxeo Studio Designer. -# Note: some Catalog dependencies require Node 10.x to work. -name: Designer Catalog Generator - -on: - workflow_dispatch: - inputs: - target_platform: - description: 'The Nuxeo server target platform to build the catalog for.' - default: '11.3' - required: true - branch_name: - description: 'The name of the Nuxeo Web UI branch to generate the catalog for.' - default: 'maintenance-3.0.x' - required: true - classifier: - description: 'Classifier to name a custom version of the catalog (used for testing purposes).' - default: '' - required: false - - release: - types: [published] - -env: - ARTIFACT_ID: view-designer-catalog - GROUP_ID: org.nuxeo.web.ui.studio - -jobs: - catalog: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - run: git config --global user.name "nuxeo-webui-jx-bot" && git config --global user.email "webui@hyland.com" - - - uses: actions/setup-node@v3 - with: - node-version: 14 - - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '11' - - - name: 'Update settings.xml with server configuration' - run: | - echo ' - - - maven-internal - external:* - https://packages.nuxeo.com/repository/maven-internal/ - - - - - nos-team - nuxeo-webui-jx-bot - ${{ secrets.WEBUI_JX_BOT_GITHUB_ACTIONS_TOKEN }} - - - maven-internal - ${{ secrets.PACKAGES_AUTH_USER }} - ${{ secrets.PACKAGES_AUTH_TOKEN }} - - - maven-public-releases - ${{ secrets.PACKAGES_AUTH_USER }} - ${{ secrets.PACKAGES_AUTH_TOKEN }} - - - maven-public-snapshots - ${{ secrets.PACKAGES_AUTH_USER }} - ${{ secrets.PACKAGES_AUTH_TOKEN }} - - - ' > ~/.m2/settings.xml - - - name: Install libxml2-utils (xmllint) - run: sudo apt-get update && sudo apt-get install -y libxml2-utils - - - name: Setup parameters (release) - if: github.event_name == 'release' - working-directory: packages/nuxeo-designer-catalog - run: | - echo "BRANCH_NAME=v${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV - echo "TARGET_PLATFORM=11.3" >> $GITHUB_ENV - - - name: Setup parameters (workflow_dispatch) - if: github.event_name == 'workflow_dispatch' - run: | - echo "BRANCH_NAME=${{ github.event.inputs.branch_name }}" >> $GITHUB_ENV - echo "TARGET_PLATFORM=${{ github.event.inputs.target_platform }}" >> $GITHUB_ENV - - - name: Install dependencies - working-directory: packages/nuxeo-designer-catalog - run: | - npm install - npm install -g gulp - - - name: Generate catalog - working-directory: packages/nuxeo-designer-catalog - run: | - gulp catalog --tp $TARGET_PLATFORM --webui-branch $BRANCH_NAME - gulp hints --tp $TARGET_PLATFORM - - - name: Bundle the catalog - run: | - sudo chmod +r pom.xml - CATALOG_VERSION=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)${{ github.event.inputs.classifier }} - pushd packages/nuxeo-designer-catalog/data/applications/nuxeo/${{ env.TARGET_PLATFORM }} - echo "CATALOG_VERSION=$CATALOG_VERSION" >> $GITHUB_ENV - CATALOG_NAME=$ARTIFACT_ID-$CATALOG_VERSION.zip - echo "CATALOG_NAME=$CATALOG_NAME" >> $GITHUB_ENV - zip -q -r $CATALOG_NAME nuxeo-web-ui data hints catalog.json - popd - - - name: Archive catalog - uses: actions/upload-artifact@v3 - with: - name: catalog - path: packages/nuxeo-designer-catalog/data/applications/nuxeo/${{ env.TARGET_PLATFORM }}/${{ env.CATALOG_NAME }} - - - name: Upload catalog - working-directory: packages/nuxeo-designer-catalog - run: | - MVN_REPO_ID=maven-public-releases - MVN_REPO_URL=https://packages.nuxeo.com/repository/maven-public-releases/ - if [[ $CATALOG_VERSION == *-SNAPSHOT ]]; then - MVN_REPO_ID=maven-public-snapshots - MVN_REPO_URL=https://packages.nuxeo.com/repository/maven-public-snapshots/ - fi - - pushd data/applications/nuxeo/$TARGET_PLATFORM - mvn deploy:deploy-file -Dfile=$CATALOG_NAME -DgroupId=$GROUP_ID -DartifactId=$ARTIFACT_ID -Dversion=$CATALOG_VERSION -Dpackaging=zip -DrepositoryId=$MVN_REPO_ID -Durl=$MVN_REPO_URL - popd - - - name: Checkout NOS repository - uses: actions/checkout@v3 - with: - repository: nuxeo/nos - token: ${{ secrets.WEBUI_JX_BOT_GITHUB_ACTIONS_TOKEN }} - path: nos - - - name: Create pull request for catalog update in NOS - working-directory: nos - env: - GH_TOKEN: ${{ secrets.WEBUI_JX_BOT_GITHUB_ACTIONS_TOKEN }} - run: | - git checkout -b designer-catalog-update-$CATALOG_VERSION - mvn versions:set-property -Dproperty=view.designer.catalog.11.3 -DnewVersion=$CATALOG_VERSION - git add . - git commit -m "Update Designer catalog with version $CATALOG_VERSION" - git push origin designer-catalog-update-$CATALOG_VERSION - gh pr create --base master --fill \ No newline at end of file diff --git a/.github/workflows/cross-repo.yaml b/.github/workflows/cross-repo.yaml index dd907a26ca..e69de29bb2 100644 --- a/.github/workflows/cross-repo.yaml +++ b/.github/workflows/cross-repo.yaml @@ -1,241 +0,0 @@ -# This workflow is not intended to be triggered manually from the Web UI repository, -# but to be called from the Elements repository cross repo check instead. -name: Cross repo check - -on: - workflow_dispatch: - inputs: - branch_name: - description: 'The name of the branch to build.' - default: 'maintenance-3.0.x' - required: true - sauce_labs: - description: 'Run unit tests on Sauce Labs?' - default: true - type: boolean - required: false - skip_ftests: - description: 'Skip functional tests?' - type: boolean - required: false - skip_a11y: - description: 'Skip accessibility tests?' - type: boolean - required: false - skip_unit_tests: - description: 'Skip unit tests?' - type: boolean - required: false - generate_metrics: - description: 'Generate metrics report?' - type: boolean - required: false - run_all: - description: 'Skip fail fast premise?' - type: boolean - required: false - bail: - description: 'Number of failed features to stop test runner (0 means not applicable).' - default: 0 - required: false - caller_id: - description: 'run identifier' - default: 'maintenance-3.0.x' - type: string - required: false - -env: - REFERENCE_BRANCH: maintenance-3.0.x - NPM_REPOSITORY: https://packages.nuxeo.com/repository/npm-public/ - -jobs: - id: - name: Remote Caller ID ${{ github.event.inputs.caller_id }} - runs-on: ubuntu-latest - steps: - - name: ${{ github.event.inputs.id }} - run: echo run identifier ${{ github.event.inputs.id }} - build: - name: Build - needs: id - runs-on: [ self-hosted, master ] - steps: - - name: Build parameters - run: echo '${{ toJSON(github.event.inputs) }}' - - - uses: actions/setup-node@v3 - with: - registry-url: ${{ env.NPM_REPOSITORY }} - scope: '@nuxeo' - node-version: 18 - - - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: '11' - - - name: Determine nuxeo-web-ui branch to use - uses: nuxeo/ui-team-gh-actions/get-branch@ca09d5c52a62e297502d3572c36d813be927982a - id: pick_nuxeo_web_ui_branch - with: - repository: nuxeo/nuxeo-web-ui - branch: ${{ github.event.inputs.branch_name }} - default-branch: ${{ env.REFERENCE_BRANCH }} - - - name: Determine nuxeo-elements branch to use - id: pick_nuxeo_elements_branch - uses: nuxeo/ui-team-gh-actions/get-branch@ca09d5c52a62e297502d3572c36d813be927982a - with: - repository: nuxeo/nuxeo-elements - branch: ${{ github.event.inputs.branch_name }} - default-branch: ${{ env.REFERENCE_BRANCH }} - - - name: Checkout nuxeo-web-ui repo - uses: actions/checkout@v2 - with: - repository: nuxeo/nuxeo-web-ui - ref: ${{ steps.pick_nuxeo_web_ui_branch.outputs.branch }} - - - name: Install Web UI - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} - run: | - npm install - pushd packages/nuxeo-web-ui-ftest - npm install - popd - pushd packages/nuxeo-designer-catalog - npm install - popd - - - name: Lint Web UI - run: npm run lint - - - name: Checkout the nuxeo-elements repo - uses: actions/checkout@v2 - with: - repository: nuxeo/nuxeo-elements - path: nuxeo-elements - fetch-depth: 1 - ref: ${{ steps.pick_nuxeo_elements_branch.outputs.branch }} - - - name: Pack Elements modules - run: | - pushd nuxeo-elements - pushd core - echo "ELEMENTS_CORE=$(npm pack 2>&1 | tail -1)" >> $GITHUB_ENV - popd - - pushd ui - echo "ELEMENTS_UI=$(npm pack 2>&1 | tail -1)" >> $GITHUB_ENV - popd - - pushd dataviz - echo "ELEMENTS_DATAVIZ=$(npm pack 2>&1 | tail -1)" >> $GITHUB_ENV - popd - - pushd testing-helpers - echo "ELEMENTS_HELPERS=$(npm pack 2>&1 | tail -1)" >> $GITHUB_ENV - popd - popd - - - name: Add .npmrc - run: | - pushd /tmp/_temp/ - rm .npmrc - touch .npmrc - popd - echo ' - packages.nuxeo.com/repository/npm-public/:_auth=${NODE_AUTH_TOKEN} - @nuxeo:registry=https://packages.nuxeo.com/repository/npm-public/ - always-auth=true - ' >> /tmp/_temp/.npmrc - - - name: Link elements to Web UI - run: | - npm install --no-package-lock --@nuxeo:registry="${{ env.NPM_REPOSITORY }}" nuxeo-elements/core/${ELEMENTS_CORE} - npm install --no-package-lock --@nuxeo:registry="${{ env.NPM_REPOSITORY }}" nuxeo-elements/ui/${ELEMENTS_UI} - npm install --no-package-lock --@nuxeo:registry="${{ env.NPM_REPOSITORY }}" nuxeo-elements/dataviz/${ELEMENTS_DATAVIZ} - npm install --no-package-lock --@nuxeo:registry="${{ env.NPM_REPOSITORY }}" nuxeo-elements/testing-helpers/${ELEMENTS_HELPERS} - - - name: Web UI Unit tests - if: ${{ github.event.inputs.skip_unit_tests == 'false' && github.event.inputs.sauce_labs == 'false' }} - run: npm run test - - - name: Web UI Unit tests (Sauce Labs) - if: ${{ github.event.inputs.skip_unit_tests == 'false' && github.event.inputs.sauce_labs == 'true' }} - env: - SAUCE_USERNAME: nuxeo-web-ui - SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} - run: npm run test - - - name: 'Update settings.xml with server configuration' - run: | - echo ' - - - maven-internal - ${{ secrets.PACKAGES_AUTH_USER }} - ${{ secrets.PACKAGES_AUTH_TOKEN }} - - - ' > ~/.m2/settings.xml - - - name: Nuxeo package build and Ftests - env: - RUN_ALL: ${{ github.event.inputs.run_all }} - BAIL: ${{ github.event.inputs.bail }} - run: | - profiles=() - if [ ${{ github.event.inputs.skip_ftests }} = "false" ] - then - profiles+=('ftest') - fi - if ${{ github.event.inputs.generate_metrics }} - then - profiles+=('metrics') - fi - active_profiles="" - if [ ${#profiles[@]} -gt 0 ] - then - active_profiles="-P$(printf -v active_profiles '%s,' "${profiles[@]}" && echo "${active_profiles%,}")" - fi - mvn install -ntp $active_profiles -DskipInstall - - - name: A11y checks - if: ${{ github.event.inputs.skip_a11y == 'false' }} - run: | - mvn -B -nsu -f plugin/a11y -ntp install - - - name: Archive cucumber reports - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: cucumber-reports - path: | - ftest/target/cucumber-reports/ - - - name: Archive screenshots - if: ${{ failure() }} - uses: actions/upload-artifact@v2 - with: - name: screenshots - path: ftest/target/screenshots/ - - - name: Archive logs - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: logs - path: | - **/log/*.log - **/nxserver/config/distribution.properties - - - name: Archive packages - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: packages - path: | - plugin/web-ui/marketplace/target/nuxeo-web-ui-marketplace-*.zip - plugin/itests/marketplace/target/nuxeo-web-ui-marketplace-itests-*.zip diff --git a/.github/workflows/crowdin.yaml b/.github/workflows/crowdin.yaml index e16599742d..e69de29bb2 100644 --- a/.github/workflows/crowdin.yaml +++ b/.github/workflows/crowdin.yaml @@ -1,59 +0,0 @@ -# Workflow that syncronizes translations from Crowdin -name: Crowdin Sync - -on: - # Check for updates every day - schedule: - - cron: '0 0 * * *' - - # Sync when a commit is done on maintenance-3.0.x - push: - branches: - - maintenance-3.0.x - paths: - - 'i18n/messages.json' - - # Manually trigger the workflow - workflow_dispatch: - -jobs: - crowdin: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Crowdin Action - uses: crowdin/github-action@v1 - with: - # Tokens - project_id: ${{ secrets.CROWDIN_PROJECT_ID }} - token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - # Load external configuration file (to support translation rename) - config: crowdin-conf.yml - - # Upload sources for translation - upload_sources: true - - # Auto-approve reference sentences we are pushing (english) - auto_approve_imported: true - - # Name of the branch where to merge the translations - localization_branch_name: crowdin-translations-update - create_pull_request: true - pull_request_title: 'New Crowdin translations' - pull_request_body: 'New Crowdin pull request with translations' - - # The commit message - commit_message: 'Automatic update of translations from Crowdin' - - # Automatically download all the new translations - download_translations: true - - # User properties - github_user_name: nuxeo-webui-jx-bot - github_user_email: webui@hyland.com - - env: - GITHUB_TOKEN: ${{ secrets.WEBUI_JX_BOT_GITHUB_ACTIONS_TOKEN }} diff --git a/.github/workflows/ftest.yaml b/.github/workflows/ftest.yaml index 994d71fbfc..e69de29bb2 100644 --- a/.github/workflows/ftest.yaml +++ b/.github/workflows/ftest.yaml @@ -1,165 +0,0 @@ -name: Functional tests - -on: - pull_request: - branches: - - maintenance-3.0.x - workflow_call: - inputs: - branch: - description: 'The current branch' - default: maintenance-3.0.x - type: string - required: false - secrets: - NPM_PACKAGES_TOKEN: - description: 'NPM_PACKAGES_TOKEN' - required: true - PACKAGES_AUTH_USER: - description: 'PACKAGES_AUTH_USER' - required: true - PACKAGES_AUTH_TOKEN: - description: 'PACKAGES_AUTH_TOKEN' - required: true - -env: - REFERENCE_BRANCH: maintenance-3.0.x - NPM_REPOSITORY: https://packages.nuxeo.com/repository/npm-public/ - BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'maintenance-3.0.x' }} - -jobs: - ftests: - runs-on: [ self-hosted, master ] - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ env.BRANCH_NAME }} - - - uses: actions/setup-node@v3 - with: - registry-url: ${{ env.NPM_REPOSITORY }} - scope: '@nuxeo' - node-version: 18 - - - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: '11' - - - name: Determine nuxeo-elements branch to link - id: pick_nuxeo_elements_branch - run: | - if git ls-remote --exit-code --heads https://github.com/nuxeo/nuxeo-elements ${{ env.BRANCH_NAME }}; then - echo ::set-output name=branch::${{ env.BRANCH_NAME }} - else - echo ::set-output name=branch::${{ env.REFERENCE_BRANCH }} - fi - - - name: Install Web UI - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} - run: | - npm install - pushd packages/nuxeo-web-ui-ftest - npm install - popd - pushd packages/nuxeo-designer-catalog - npm install - popd - - - name: Checkout the nuxeo-elements repo - uses: actions/checkout@v2 - with: - repository: nuxeo/nuxeo-elements - path: nuxeo-elements - fetch-depth: 1 - ref: ${{ steps.pick_nuxeo_elements_branch.outputs.branch }} - - - name: Pack Elements modules - run: | - pushd nuxeo-elements - pushd core - echo "ELEMENTS_CORE=$(npm pack 2>&1 | tail -1)" >> $GITHUB_ENV - popd - - pushd ui - echo "ELEMENTS_UI=$(npm pack 2>&1 | tail -1)" >> $GITHUB_ENV - popd - - pushd dataviz - echo "ELEMENTS_DATAVIZ=$(npm pack 2>&1 | tail -1)" >> $GITHUB_ENV - popd - - pushd testing-helpers - echo "ELEMENTS_HELPERS=$(npm pack 2>&1 | tail -1)" >> $GITHUB_ENV - popd - popd - - - name: Add .npmrc - run: | - pushd /tmp/_temp/ - rm .npmrc - touch .npmrc - popd - echo ' - packages.nuxeo.com/repository/npm-public/:_auth=${NODE_AUTH_TOKEN} - @nuxeo:registry=https://packages.nuxeo.com/repository/npm-public/ - always-auth=true - ' >> /tmp/_temp/.npmrc - - - name: Link elements to Web UI - run: | - npm install --no-package-lock --@nuxeo:registry="${{ env.NPM_REPOSITORY }}" nuxeo-elements/core/${ELEMENTS_CORE} - npm install --no-package-lock --@nuxeo:registry="${{ env.NPM_REPOSITORY }}" nuxeo-elements/ui/${ELEMENTS_UI} - npm install --no-package-lock --@nuxeo:registry="${{ env.NPM_REPOSITORY }}" nuxeo-elements/dataviz/${ELEMENTS_DATAVIZ} - npm install --no-package-lock --@nuxeo:registry="${{ env.NPM_REPOSITORY }}" nuxeo-elements/testing-helpers/${ELEMENTS_HELPERS} - - - name: 'Update settings.xml with server configuration' - run: | - echo ' - - - maven-internal - ${{ secrets.PACKAGES_AUTH_USER }} - ${{ secrets.PACKAGES_AUTH_TOKEN }} - - - ' > ~/.m2/settings.xml - - - name: Functional tests - env: - RUN_ALL: false - BAIL: 0 - run: mvn -ntp install -Pftest -DskipInstall - - - name: Archive cucumber reports - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: cucumber-reports - path: ftest/target/cucumber-reports/ - - - name: Archive screenshots - if: ${{ failure() }} - uses: actions/upload-artifact@v2 - with: - name: screenshots - path: ftest/target/screenshots/ - - - name: Archive logs - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: logs - path: | - **/log/*.log - **/nxserver/config/distribution.properties - - - name: Archive packages - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: packages - path: | - plugin/web-ui/marketplace/target/nuxeo-web-ui-marketplace-*.zip - plugin/itests/marketplace/target/nuxeo-web-ui-marketplace-itests-*.zip diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index dd625b005d..e69de29bb2 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,42 +0,0 @@ -name: Lint - -on: - pull_request: - branches: - - maintenance-3.0.x - workflow_call: - inputs: - branch: - description: 'The current branch' - default: maintenance-3.0.x - type: string - required: false - secrets: - NPM_PACKAGES_TOKEN: - description: 'NPM_PACKAGES_TOKEN' - required: true - -env: - BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'maintenance-3.0.x' }} - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ env.BRANCH_NAME }} - - - uses: actions/setup-node@v3 - with: - registry-url: 'https://packages.nuxeo.com/repository/npm-public/' - node-version: 18 - scope: '@nuxeo' - - - name: Install - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm install - - - name: Lint - run: npm run lint diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4ceda98307..e69de29bb2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,147 +0,0 @@ -name: Main - -on: - push: - branches: - - maintenance-3.0.x - - # Manually trigger the workflow - workflow_dispatch: - -jobs: - lint: - uses: nuxeo/nuxeo-web-ui/.github/workflows/lint.yaml@maintenance-3.0.x - secrets: - NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} - - test: - uses: nuxeo/nuxeo-web-ui/.github/workflows/test.yaml@maintenance-3.0.x - secrets: - NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} - SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} - with: - branch: maintenance-3.0.x - - a11y: - uses: nuxeo/nuxeo-web-ui/.github/workflows/a11y.yaml@maintenance-3.0.x - secrets: - NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} - PACKAGES_AUTH_USER: ${{ secrets.PACKAGES_AUTH_USER }} - PACKAGES_AUTH_TOKEN: ${{ secrets.PACKAGES_AUTH_TOKEN }} - with: - branch: maintenance-3.0.x - - ftest: - uses: nuxeo/nuxeo-web-ui/.github/workflows/ftest.yaml@maintenance-3.0.x - secrets: - NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} - PACKAGES_AUTH_USER: ${{ secrets.PACKAGES_AUTH_USER }} - PACKAGES_AUTH_TOKEN: ${{ secrets.PACKAGES_AUTH_TOKEN }} - with: - branch: maintenance-3.0.x - - build: - needs: [ lint, test, a11y, ftest ] - runs-on: [ self-hosted, master ] - steps: - - uses: actions/checkout@v2 - - - run: git config user.name "nuxeo-webui-jx-bot" && git config user.email "webui@hyland.com" - - - uses: actions/setup-node@v3 - with: - registry-url: 'https://packages.nuxeo.com/repository/npm-public/' - scope: '@nuxeo' - - - name: Prepare environment - run: | - echo "BRANCH_NAME=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV - echo "PACKAGE_VERSION=$(npx -c 'echo "$npm_package_version"')" >> $GITHUB_ENV - - - name: Get prerelease version - run: | - git fetch origin --tags - RC_VERSION=$(git tag --sort=taggerdate --list "v${PACKAGE_VERSION/-SNAPSHOT}*" | tail -1 | tr -d '\n') - echo "VERSION=$(npx semver -i prerelease --preid rc ${RC_VERSION:-$PACKAGE_VERSION} | tr -d '\n')" >> $GITHUB_ENV - - - name: Update versions - run: | - find . -type f -not -path "./node_modules/*" -regex ".*\.\(yaml\|sample\|xml\)" -exec sed -i 's/'"$PACKAGE_VERSION"'/'"$VERSION"'/g' {} \; - - # set padded version to build package for connect preprod - PADDED=$(printf '%03d' $(echo $VERSION | sed -r s/[0-9]+\.[0-9]+\.[0-9]+-rc\.\([0-9]+\)/\\1/g)) - PADDED_VERSION=$(echo $VERSION | sed -E "s/([0-9]+\.[0-9]+\.[0-9]+-rc\.)[0-9]+/\\1$PADDED/g") - echo "PADDED_VERSION=$PADDED_VERSION" >> $GITHUB_ENV - sed -i -e 's/\${project.version}/'"$PADDED_VERSION"'/g' plugin/web-ui/marketplace/pom.xml - - npm version ${VERSION} --no-git-tag-version - pushd packages/nuxeo-web-ui-ftest - npm version ${VERSION} --no-git-tag-version - popd - - - name: Install - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - npm install - pushd packages/nuxeo-web-ui-ftest - npm install - popd - pushd packages/nuxeo-designer-catalog - npm install - popd - - - name: 'Update settings.xml with server configuration' - run: | - echo ' - - - maven-internal - ${{ secrets.PACKAGES_AUTH_USER }} - ${{ secrets.PACKAGES_AUTH_TOKEN }} - - - ' > ~/.m2/settings.xml - - - name: Nuxeo package build - run: | - mvn -ntp install -DskipInstall - mvn -B -nsu -ntp -f plugin/itests/addon install - mvn -B -nsu -ntp -f plugin/itests/marketplace install - - - name: Archive packages - uses: actions/upload-artifact@v2 - with: - name: packages - path: | - plugin/web-ui/marketplace/target/nuxeo-web-ui-marketplace-*.zip - plugin/itests/marketplace/target/nuxeo-web-ui-marketplace-itests-*.zip - - - name: Tag - run: | - git add package-lock.json packages/nuxeo-web-ui-ftest/package-lock.json - git commit -a -m "Release ${VERSION}" - git tag -a v${VERSION} -m "Release ${VERSION}" - git push origin v${VERSION} - - - name: Publish Nuxeo packages - env: - CONNECT_PREPROD_URL: https://nos-preprod-connect.nuxeocloud.com/nuxeo - run: | - PACKAGE="plugin/web-ui/marketplace/target/nuxeo-web-ui-marketplace-${PADDED_VERSION}.zip" - STATUS_CODE=`curl -i --silent --output publish-req.output -w "%{http_code}" -u "${{ secrets.CONNECT_PREPROD_AUTH }}" -F package=@$PACKAGE "$CONNECT_PREPROD_URL/site/marketplace/upload?batch=true"` - cat publish-req.output - if [[ "$STATUS_CODE" != "200" ]] - then - exit 1 - else - exit 0 - fi - - - name: Publish Web UI FTest framework - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - pushd packages/nuxeo-web-ui-ftest/ - npm publish --@nuxeo:registry=https://packages.nuxeo.com/repository/npm-public/ --tag SNAPSHOT - popd diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 6cb902fb5c..e69de29bb2 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -1,197 +0,0 @@ -name: Preview - -on: - pull_request: - types: [opened, synchronize, reopened, labeled] - branches: - - maintenance-3.0.x - - workflow_dispatch: - inputs: - branch_name: - description: 'The name of the branch to preview.' - default: 'maintenance-3.0.x' - required: true - caller_id: - description: 'run identifier' - default: 'maintenance-3.0.x' - type: string - required: false - -env: - DOCKER_REGISTRY: us-east1-docker.pkg.dev - DOCKER_IMAGE: ${{ secrets.GKE_PROJECT }}/webui/nuxeo-web-ui - GKE_CLUSTER: jx-prod - GKE_ZONE: us-east1-b - -jobs: - id: - name: Remote Caller ID ${{ github.event.inputs.caller_id }} - runs-on: ubuntu-latest - steps: - - name: ${{ github.event.inputs.id }} - run: echo run identifier ${{ github.event.inputs.id }} - preview: - needs: id - name: Setup - outputs: - url: ${{ steps.preview.outputs.url }} - if: (github.event.action == 'labeled' && github.event.label.name == 'preview') || contains(github.event.pull_request.labels.*.name, 'preview') || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - steps: - - uses: actions/setup-node@v3 - with: - node-version: 18 - registry-url: 'https://packages.nuxeo.com/repository/npm-public/' - scope: '@nuxeo' - - - name: Setup branch name (pull_request) - if: github.event_name == 'pull_request' - run: | - BRANCH_NAME=${GITHUB_HEAD_REF##*/} - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - - - name: Setup branch name (workflow_dispatch) - if: github.event_name == 'workflow_dispatch' - run: | - BRANCH_NAME=${{ github.event.inputs.branch_name }} - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - - - name: Determine nuxeo-web-ui branch to use - uses: nuxeo/ui-team-gh-actions/get-branch@ca09d5c52a62e297502d3572c36d813be927982a - id: pick_nuxeo_web_ui_branch - with: - repository: nuxeo/nuxeo-web-ui - branch: ${BRANCH_NAME} - default-branch: maintenance-3.0.x - - - uses: actions/checkout@v3 - with: - ref: ${{ steps.pick_nuxeo_web_ui_branch.outputs.branch }} - - - name: Prepare environment - run: | - echo "VERSION=$(npx -c 'echo "$npm_package_version"')-$BRANCH_NAME" >> $GITHUB_ENV - echo "PREVIEW_NAMESPACE=$(printf '%.53s' $(echo nuxeo-web-ui-$(echo $BRANCH_NAME | sed 's/[^[:alnum:]-]/-/g' | tr '[:upper:]' '[:lower:]')))" >> $GITHUB_ENV - - - name: Determine nuxeo-elements branch to use - id: pick_nuxeo_elements_branch - uses: nuxeo/ui-team-gh-actions/get-branch@ca09d5c52a62e297502d3572c36d813be927982a - with: - repository: nuxeo/nuxeo-elements - branch: ${BRANCH_NAME} - default-branch: maintenance-3.0.x - - - name: Checkout the nuxeo-elements repo - uses: actions/checkout@v2 - with: - repository: nuxeo/nuxeo-elements - path: nuxeo-elements - fetch-depth: 1 - ref: ${{ steps.pick_nuxeo_elements_branch.outputs.branch }} - - - name: Install - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - npm install nuxeo-elements/core - npm install nuxeo-elements/ui - npm install nuxeo-elements/dataviz - npm install - - - name: Webpack build - run: | - npm run build - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: _json_key - password: ${{ secrets.GKE_SA_KEY }} - - - name: Build and push server image - uses: docker/build-push-action@v2 - with: - context: server - pull: true - push: true - file: server/Dockerfile - tags: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}/server:${{ env.VERSION }} - - - name: Build and push image - uses: docker/build-push-action@v2 - with: - context: . - pull: true - push: true - file: Dockerfile - tags: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:${{ env.VERSION }} - build-args: SERVER_IMAGE=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}/server:${{ env.VERSION }} - - - name: Get GKE credentials - uses: google-github-actions/get-gke-credentials@v0.2.1 - with: - cluster_name: ${{ env.GKE_CLUSTER }} - location: ${{ env.GKE_ZONE }} - project_id: ${{ secrets.GKE_PROJECT }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: Check preview namespace - id: preview_ns - run: | - echo ::set-output name=exists::$(kubectl get namespace ${PREVIEW_NAMESPACE}) - - - name: Create preview namespace - if: ${{ !steps.preview_ns.outputs.exists }} - run: | - kubectl create namespace ${PREVIEW_NAMESPACE} - - - name: Install preview - id: preview - working-directory: ./charts/preview - run: | - # add helm jx repo - helm repo add jx https://jenkins-x-charts.github.io/v2/ - - # substitute env variables in values.yaml - mv values.yaml values.yaml.tosubst - envsubst < values.yaml.tosubst > values.yaml - - # update helm deps - helm dependency update . - - # install - helm upgrade --install --namespace ${PREVIEW_NAMESPACE} ${PREVIEW_NAMESPACE} . - - # ensure the deployment is restarted to pull the new preview image - kubectl rollout restart deployment ${PREVIEW_NAMESPACE}-preview --namespace ${PREVIEW_NAMESPACE} - - echo "PREVIEW_URL=https://preview-${PREVIEW_NAMESPACE}.webui.dev.nuxeo.com" >> $GITHUB_ENV - - echo ::set-output name=url::"https://preview-${PREVIEW_NAMESPACE}.webui.dev.nuxeo.com" - - - uses: actions/github-script@0.9.0 - if: github.event_name == 'pull_request' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `:star: PR built and available [here](${process.env.PREVIEW_URL})` - }) - - result: - name: "Result: ${{ needs.preview.outputs.url }}" - needs: preview - runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' - steps: - - name: "Result: ${{ needs.preview.outputs.url }}" - run: | - echo ${{ needs.preview.outputs.url }} diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml index 9f8dbd3237..e69de29bb2 100644 --- a/.github/workflows/promote.yaml +++ b/.github/workflows/promote.yaml @@ -1,164 +0,0 @@ -name: Promote release - -on: - workflow_dispatch: - inputs: - version: - description: 'Version to promote (e.g.: 3.0.6-rc.6)' - required: true - referenceBranch: - description: 'Branch to be updated after the promotion' - required: true - default: 'maintenance-3.0.x' - dryRun: - description: 'Run the workflow without pushing code or publishing artifacts' - type: boolean - required: false - -jobs: - promote: - runs-on: ubuntu-latest - steps: - - uses: actions/setup-node@v3 - with: - node-version: 18 - registry-url: 'https://packages.nuxeo.com/repository/npm-public/' - scope: '@nuxeo' - - - uses: actions/checkout@v2 - with: - ref: v${{ github.event.inputs.version }} - - - run: git config user.name "nuxeo-webui-jx-bot" && git config user.email "webui@hyland.com" - - - run: echo "VERSION=$(echo '${{ github.event.inputs.version }}' | sed -e 's/-rc.[0-9]*//')" >> $GITHUB_ENV - - - name: Update Nuxeo Web UI version to ${{ env.VERSION }} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - OLD_VERSION=$(npx -c 'echo "$npm_package_version"') - npm version $VERSION --no-git-tag-version - pushd packages/nuxeo-web-ui-ftest/ - npm version $VERSION --no-git-tag-version - popd - - find . -type f -not -path "./node_modules/*" -regex ".*\.\(yaml\|sample\|xml\)" -exec sed -i 's/'"$OLD_VERSION"'/'"$VERSION"'/g' {} \; - # XXX: undo the padded lock (see WEBUI-140) - sed -i -e 's/.*<\/webui.package.version>/${project.version}<\/webui.package.version>/g' plugin/web-ui/marketplace/pom.xml - - # align on same promoted version of elements - npm i @nuxeo/nuxeo-elements@$VERSION --save-exact - npm i @nuxeo/nuxeo-dataviz-elements@$VERSION --save-exact - npm i @nuxeo/nuxeo-ui-elements@$VERSION --save-exact - npm i @nuxeo/testing-helpers@$VERSION --save-exact - - - name: Perform git release of Nuxeo Web UI ${{ env.VERSION }} - run: | - git commit -a -m "Release $VERSION" - git tag -a v$VERSION -m "Release $VERSION" - - - if: ${{ github.event.inputs.dryRun == 'false' }} - run: git push origin v$VERSION - - - name: Create Github release v${{ env.VERSION }} - if: ${{ github.event.inputs.dryRun == 'false' }} - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ env.VERSION }} - release_name: Release ${{ env.VERSION }} - - - name: Publish Nuxeo Web UI FTest ${{ env.VERSION }} - if: ${{ github.event.inputs.dryRun == 'false' }} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - pushd packages/nuxeo-web-ui-ftest/ - npm publish --@nuxeo:registry=https://packages.nuxeo.com/repository/npm-public/ - popd - - - name: Promote Web UI ${{ github.event.inputs.version }} to ${{ env.VERSION }} - env: - PACKAGE: nuxeo-web-ui-${{ env.VERSION }} - CONNECT_PREPROD_URL: https://nos-preprod-connect.nuxeocloud.com/nuxeo - run: | - PADDED=$(printf '%03d' $(echo ${{ github.event.inputs.version }} | sed -r s/[0-9]+\.[0-9]+\.[0-9]+-rc\.\([0-9]+\)/\\1/g)) - PADDED_VERSION=$(echo ${{ github.event.inputs.version }} | sed -E "s/([0-9]+\.[0-9]+\.[0-9]+-rc\.)[0-9]+/\\1$PADDED/g") - curl -o $PACKAGE.zip -L -u "${{ secrets.CONNECT_PREPROD_AUTH }}" "$CONNECT_PREPROD_URL/site/marketplace/package/nuxeo-web-ui/download?version=$PADDED_VERSION" - unzip -d $PACKAGE $PACKAGE.zip && rm $PACKAGE.zip - pushd $PACKAGE - sed -i 's/-rc.[0-9]*//' package.xml - for f in install/bundles/*.jar; do mv $f $(echo $f | sed -e 's/-rc.[0-9]*//'); done - zip -r ../$PACKAGE.zip . - popd - - - name: Push promoted Web UI to Connect PREPROD - if: ${{ github.event.inputs.dryRun == 'false' }} - env: - PACKAGE: nuxeo-web-ui-${{ env.VERSION }} - CONNECT_PREPROD_URL: https://nos-preprod-connect.nuxeocloud.com/nuxeo - run: curl -i -u "${{ secrets.CONNECT_PREPROD_AUTH }}" -F package=@$PACKAGE.zip "$CONNECT_PREPROD_URL/site/marketplace/upload?batch=true" - - - name: Push promoted Web UI to Connect PROD - if: ${{ github.event.inputs.dryRun == 'false' }} - env: - PACKAGE: nuxeo-web-ui-${{ env.VERSION }} - CONNECT_URL: https://connect.nuxeo.com/nuxeo - run: curl -i -u "${{ secrets.CONNECT_AUTH }}" -F package=@$PACKAGE.zip "$CONNECT_URL/site/marketplace/upload?batch=true" - - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GIT_ADMIN_TOKEN }} - ref: ${{ github.event.inputs.referenceBranch }} - - - if: ${{ github.event.inputs.referenceBranch == 'master' }} - run: echo "NEW_VERSION=$(npx semver -i minor $VERSION)" >> $GITHUB_ENV - - - if: ${{ github.event.inputs.referenceBranch != 'master' }} - run: echo "NEW_VERSION=$(npx semver -i patch $VERSION)" >> $GITHUB_ENV - - - name: Align ${{ github.event.inputs.referenceBranch }} branch on next version ${{ env.NEW_VERSION }}-SNAPSHOT - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo "OLD_SNAPSHOT=$(npx -c 'echo "$npm_package_version"')" >> $GITHUB_ENV - - # bump version to next SNAPSHOT and align on the corresponding Elements release candidate - NEW_SNAPSHOT=$NEW_VERSION-SNAPSHOT - npm version $NEW_SNAPSHOT --no-git-tag-version - pushd packages/nuxeo-web-ui-ftest/ - npm version $NEW_SNAPSHOT --no-git-tag-version - popd - - - if: ${{ github.event.inputs.referenceBranch == 'master' }} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - NEW_ELEMENTS_VERSION="^$NEW_VERSION-rc" - npm i @nuxeo/nuxeo-elements@$NEW_ELEMENTS_VERSION --save-prefix="^" - npm i @nuxeo/nuxeo-dataviz-elements@$NEW_ELEMENTS_VERSION --save-prefix="^" - npm i @nuxeo/nuxeo-ui-elements@$NEW_ELEMENTS_VERSION --save-prefix="^" - npm i @nuxeo/testing-helpers@$NEW_ELEMENTS_VERSION --save-prefix="^" - - - if: ${{ github.event.inputs.referenceBranch != 'master' }} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - NEW_ELEMENTS_VERSION="~$NEW_VERSION-rc" - npm i @nuxeo/nuxeo-elements@$NEW_ELEMENTS_VERSION --save-prefix="~" - npm i @nuxeo/nuxeo-dataviz-elements@$NEW_ELEMENTS_VERSION --save-prefix="~" - npm i @nuxeo/nuxeo-ui-elements@$NEW_ELEMENTS_VERSION --save-prefix="~" - npm i @nuxeo/testing-helpers@$NEW_ELEMENTS_VERSION --save-prefix="~" - - - run: | - NEW_SNAPSHOT="$NEW_VERSION-SNAPSHOT" - - find . -type f -not -path "./node_modules/*" -regex ".*\.\(yaml\|sample\|xml\)" -exec sed -i 's/'"$OLD_SNAPSHOT"'/'"$NEW_SNAPSHOT"'/g' {} \; - - # commit and push - git commit -a -m "Update $OLD_SNAPSHOT to $NEW_SNAPSHOT" - - - if: ${{ github.event.inputs.dryRun == 'false' }} - run: git push origin ${{ github.event.inputs.referenceBranch }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a5d475d62f..e69de29bb2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,48 +0,0 @@ -name: Test - -on: - pull_request: - branches: - - maintenance-3.0.x - workflow_call: - inputs: - branch: - description: 'The current branch' - default: maintenance-3.0.x - type: string - required: false - secrets: - NPM_PACKAGES_TOKEN: - description: 'NPM_PACKAGES_TOKEN' - required: true - SAUCE_ACCESS_KEY: - description: 'SAUCE_ACCESS_KEY' - required: true - -env: - BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'maintenance-3.0.x' }} - -jobs: - unit-test: - runs-on: [ self-hosted, master ] - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ env.BRANCH_NAME }} - - - uses: actions/setup-node@v3 - with: - registry-url: 'https://packages.nuxeo.com/repository/npm-public/' - scope: '@nuxeo' - node-version: 18 - - - name: Install - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm install - - - name: Unit tests - env: - SAUCE_USERNAME: nuxeo-web-ui - SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} - run: npm run test diff --git a/.github/workflows/veracode.yml b/.github/workflows/veracode.yml index 560d4939b6..aa2ccada2f 100644 --- a/.github/workflows/veracode.yml +++ b/.github/workflows/veracode.yml @@ -99,7 +99,10 @@ jobs: - name: add .npmrc run: | - ls -al + cat .npmrc + echo ' + packages.nuxeo.com/repository/npm-public/:_auth=${NODE_AUTH_TOKEN} + ' >> .npmrc - name: Pack Elements modules run: |