diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index cd352a195..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,135 +0,0 @@ -version: 2.1 -jobs: - build-node18: - docker: - - image: cimg/node:18.7-browsers - working_directory: ~/repo - environment: - HUSKY_SKIP: "true" - NODE_OPTIONS: "--openssl-legacy-provider" - steps: - - run: sudo apt-get install libxss1 - - checkout - - run: yarn - - run: yarn run ci - - build-node16: - docker: - - image: cimg/node:16.17-browsers - working_directory: ~/repo - environment: - HUSKY_SKIP: "true" - steps: - - run: sudo apt-get install libxss1 - - checkout - - run: yarn - - run: yarn run ci - - build-node14: - docker: - - image: cimg/node:14.20-browsers - working_directory: ~/repo - environment: - HUSKY_SKIP: "true" - steps: - - run: sudo apt-get install libxss1 - - checkout - - run: yarn - - run: yarn run ci - - compliance: - docker: - - image: cimg/python:3.6 - working_directory: ~/workdir - environment: - HUSKY_SKIP: "true" - steps: - - checkout - - run: - name: compliance check - command: | - pip3 install --user reuse - ~/.local/bin/reuse lint - - deploy-npm: - docker: - - image: cimg/node:16.17-browsers - working_directory: ~/repo - environment: - HUSKY_SKIP: "true" - steps: - - run: sudo apt-get install libxss1 - - checkout - - run: yarn --pure-lockfile - - run: yarn run ci - - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - # To help debug when lerna detects changes to the working tree and fails the publish - - run: git status - # https://github.com/lerna/lerna/issues/2788 - - run: yarn run release:publish --no-verify-access - - prepare-vsix: - docker: - - image: cimg/node:16.17-browsers - working_directory: ~/repo - environment: - HUSKY_SKIP: "true" - steps: - - run: sudo apt-get install libxss1 - - checkout - - run: yarn - - run: yarn run ci - - persist_to_workspace: - root: "./packages/vscode-ui5-language-assistant" - paths: - # https://golang.org/pkg/path/filepath/#Match - - vscode-ui5-language-assistant-* - - deploy-gh-releases: - docker: - - image: cimg/go:1.16 - steps: - - attach_workspace: - at: ./artifacts - - run: - name: "Inspect dist Folder" - working_directory: ./artifacts - command: ls -la - - run: - name: "Publish Release on GitHub" - command: | - echo 'export GOPATH=~/go' >> $BASH_ENV - go get github.com/tcnksm/ghr - VERSION=${CIRCLE_TAG} - ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -replace ${VERSION} ./artifacts/ - -workflows: - version: 2 - voter: - jobs: - - build-node18 - - build-node16 - - build-node14 - - compliance - release: - jobs: - - deploy-npm: - filters: - tags: - only: /^v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - - prepare-vsix: - filters: - tags: - only: /^v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - - deploy-gh-releases: - requires: - - prepare-vsix - filters: - tags: - only: /^v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 000000000..2c973a34c --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,61 @@ +name: UI5-Language-Assistant + +on: + + pull_request: + branches: [ "master" ] + +jobs: + build: + env: + HUSKY_SKIP: "true" + # NODE_OPTIONS: "--openssl-legacy-provider" + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + os: [macos-latest, ubuntu-latest, windows-latest] + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + - name: Setup yarn + run: | + npm install -g yarn + yarn + - name: Build Node v18 - Linux + if: ${{ (matrix.node-version == '18.x') && (runner.os == 'Linux') }} + run: xvfb-run -a yarn run ci + env: + NODE_OPTIONS: "--openssl-legacy-provider" + - name: Build Node v18 - Others OS + if: ${{ (matrix.node-version == '18.x') && (runner.os != 'Linux') }} + run: yarn run ci + env: + NODE_OPTIONS: "--openssl-legacy-provider" + - name: Build Node v14/16 - Linux + if: ${{ (matrix.node-version != '18.x') && (runner.os == 'Linux') }} + run: xvfb-run -a yarn run ci + - name: Build Node v14/16 - Other OS + if: ${{ (matrix.node-version != '18.x') && (runner.os != 'Linux') }} + run: yarn run ci + + compliance: + runs-on: ubuntu-latest + env: + HUSKY_SKIP: "true" + steps: + - uses: actions/checkout@v3 + + - name: compliance check + run: | + sudo apt-get update + sudo apt-get -y install python3-pip + pip3 install --user reuse + ~/.local/bin/reuse lint + \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..329efacf6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,80 @@ +name: UI5-Language-Assistant + +on: + + push: + branches: [ "master" ] + +jobs: + deploy-npm: + runs-on: ubuntu-latest + env: + HUSKY_SKIP: "true" + # NODE_OPTIONS: "--openssl-legacy-provider" + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: 'yarn' + - name: Setup yarn + run: npm install -g yarn + - name: deploy-npm + run: | + sudo apt-get update + sudo apt-get install libxss1 + yarn --pure-lockfile + yarn run ci + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + # To help debug when lerna detects changes to the working tree and fails the publish + git status + # https://github.com/lerna/lerna/issues/2788 + yarn run release:publish --no-verify-access + + - name: prepare-vsix + uses: actions/upload-artifact@v3 + with: + name: vsix + path: ./packages/vscode-ui5-language-assistant/vscode-ui5-language-assistant-* + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + + + + deploy-gh-releases: + needs: deploy-npm + runs-on: ubuntu-latest + env: + HUSKY_SKIP: "true" + # NODE_OPTIONS: "--openssl-legacy-provider" + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: 'yarn' + - name: Setup yarn + run: npm install -g yarn + - uses: actions/download-artifact@v3 + with: + name: vsix + + - name: Inspect dist Folder + run: ls -R + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@main + with: + path: ./packages/vscode-ui5-language-assistant + - name: "Publish Release on GitHub" + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: ${{ steps.package-version.outputs.current-version}} + prerelease: false + title: "v${{ steps.package-version.outputs.current-version}}" + files: | + ${{steps.download.outputs.download-path}}/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6aeab05de..32cfccabb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -127,6 +127,24 @@ for each package and automatically generate the changelog by adhering to [Conven [lerna-mode]: https://github.com/lerna/lerna#independent-mode [cc]: https://www.conventionalcommits.org/en/v1.0.0/ +### Prerelease testing + +You can test the CI flow using [act](https://github.com/nektos/act). Follow the installation process and use command + +#### Pull Requests + +``` +act --detect-event pull-request +``` + +#### Complete push to master + +Prerequisite: Create a folder /tmp/ghartifacts or change the path below + +``` +act --detect-event push --artifact-server-path /tmp/ghartifacts +``` + ### Release Process Performing a release requires push permissions to the repository. @@ -134,8 +152,6 @@ Performing a release requires push permissions to the repository. - Ensure you are on `master` branch and synced with origin. - `yarn run release:version` - Follow the lerna CLI instructions. -- Track the new `/v\d+.\d+.\d+/` tag build on circle-ci. - - https://circleci.com/gh/SAP/ui5-language-assistant. - Once the tag builds have successfully finished: - Inspect the npm registry to see the new sub packages versions. - Inspect the new github release named after the new `/v\d+.\d+.\d+/` tag diff --git a/packages/vscode-ui5-language-assistant/test/run-integration-tests.ts b/packages/vscode-ui5-language-assistant/test/run-integration-tests.ts index d6b4dc866..307abe1ef 100644 --- a/packages/vscode-ui5-language-assistant/test/run-integration-tests.ts +++ b/packages/vscode-ui5-language-assistant/test/run-integration-tests.ts @@ -16,13 +16,14 @@ async function main(): Promise { const scenarioPaths = await globby(`${testPkgFolder}/**/index.js`); // Use for of + await to ensure running in sequence because vscode-test library cannot start multiple vscode instances at the same time for (const path of scenarioPaths) { - console.warn( - `SKIPPING TEST: ${path}.\nsee: https://github.com/SAP/ui5-language-assistant/issues/342` - ); - // await runTests({ - // extensionDevelopmentPath, - // extensionTestsPath: path, - // }); + // console.warn( + // `SKIPPING TEST: ${path}.\nsee: https://github.com/SAP/ui5-language-assistant/issues/342` + // ); + await runTests({ + extensionDevelopmentPath, + extensionTestsPath: path, + launchArgs: ["--disable-extensions"], + }); } } catch (err) { console.error("Failed to run tests: ", err); diff --git a/packages/vscode-ui5-language-assistant/test/suite/validations/flex-disabled/flex-disabled-spec.ts b/packages/vscode-ui5-language-assistant/test/suite/validations/flex-disabled/flex-disabled-spec.ts index 572dad7f6..b2ec0f9e6 100644 --- a/packages/vscode-ui5-language-assistant/test/suite/validations/flex-disabled/flex-disabled-spec.ts +++ b/packages/vscode-ui5-language-assistant/test/suite/validations/flex-disabled/flex-disabled-spec.ts @@ -9,7 +9,7 @@ import { const EXTENSION_START_TIMEOUT = 5000; -describe.skip("the Language Server Client Validations Integration Tests - Flex Disabled", () => { +describe("the Language Server Client Validations Integration Tests - Flex Disabled", () => { const scenarioPath = resolve( rootPkgFolder, "test", diff --git a/yarn.lock b/yarn.lock index 8f3b42bd1..9c8b5952a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8841,11 +8841,6 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - "traverse@>=0.3.0 <0.4": version "0.3.9" resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9"