diff --git a/.github/actions/execute-command/action.yaml b/.github/actions/execute-command/action.yaml new file mode 100644 index 0000000..f00ab18 --- /dev/null +++ b/.github/actions/execute-command/action.yaml @@ -0,0 +1,80 @@ +name: foo + +inputs: + command: + required: true + type: string + github_env: + required: false + type: string + default: '' + dry-run: + required: false + type: boolean + default: false + region: + required: false + type: string + default: europe-west2 + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + zone: + required: false + type: string + default: europe-west2-a + pre-targets: + description: | + Make targets to run before the command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after the command + required: false + type: string + default: '' + + + + + + +runs: + using: 'composite' + steps: + - shell: bash + run: | + echo "TAG_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV + echo "SEMVER=${{ inputs.semver }}" >> $GITHUB_ENV + echo "REGION=${{ inputs.region }}" >> $GITHUB_ENV + echo "REGISTRY=${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant" >> $GITHUB_ENV + echo "SERVICE_ACCOUNT=p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com" >> $GITHUB_ENV + echo "WORKLOAD_IDENTITY_PROVIDER=projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }}" >> $GITHUB_ENV + echo "BASE_URL=${{ vars.BASE_URL }}" >> $GITHUB_ENV + echo "ENVIRONMENT=${{ vars.ENV }}" >> $GITHUB_ENV + echo "ENV=${{ vars.ENV }}" >> $GITHUB_ENV + echo "PROJECT_NUMBER=${{ vars.PROJECT_NUMBER }}" >> $GITHUB_ENV + echo "PROJECT_ID=${{ vars.PROJECT_ID }}" >> $GITHUB_ENV + echo "TENANT_NAME=${{ vars.TENANT_NAME }}" >> $GITHUB_ENV + echo "ADDITIONAL_ENV_VARS=FOO,BAR" >> $GITHUB_ENV + + - shell: bash + run: | + echo "TAG_VERSION=$TAG_VERSION" + echo "SEMVER=$SEMVER" + echo "BASE_URL=$BASE_URL" + echo "PROJECT_ID=$PROJECT_ID" + echo "REGION=$REGION" + echo "SERVICE_ACCOUNT=$SERVICE_ACCOUNT" + echo "WORKLOAD_IDENTITY_PROVIDER=$WORKLOAD_IDENTITY_PROVIDER" + echo "REGISTRY=$REGISTRY" + echo "PROJECT_NUMBER=$PROJECT_NUMBER" + echo "TENANT_NAME=$TENANT_NAME" + echo "ENV=$ENVIRONMENT" diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..46d62a6 --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,59 @@ + +on: + pull_request: + types: [opened, synchronize, labeled, unlabeled] + +permissions: + contents: read + id-token: write + +jobs: + + testJob: + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Checkout + uses: actions/checkout@v3 + - id: set_var + run: | + content=`cat ./package.json` + # the following lines are only required for multi line json + content="${content//'%'/'%25'}" + content="${content//$'\n'/'%0A'}" + content="${content//$'\r'/'%0D'}" + # end of optional handling for multi line json + echo "::set-output name=packageJson::$content" + - run: | + echo "${{fromJson(steps.set_var.outputs.packageJson).version}}" + + + version: + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Get version1 + env: + STAGE_DEV: ${{ vars.STAGE_DEV }} + shell: bash + run: | + echo "STAGE_DEV=$STAGE_DEV" + + - name: Get version2 + env: + STAGE_DEV: ${{ fromJson(vars.STAGE_DEV).include[0]['deploy_env'] }} + shell: bash + run: | + echo "STAGE_DEV=$STAGE_DEV" + echo "STAGE_DEV=${{ fromJson(vars.STAGE_DEV).include[0]['deploy_env'] }}" +# fastfeedback: +# uses: ./.github/workflows/external-workflow-fastfeedback.yaml +# +# extendedtests: +# uses: ./.github/workflows/external-workflow-exttests.yaml +# needs: [fastfeedback] +# with: +# image_tag: ${{ needs.fastfeedback.outputs.image_tag }} +# semver: ${{ needs.fastfeedback.outputs.semver }} +## prod: +## uses: ./.github/workflows/external-workflow-prod.yaml \ No newline at end of file diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml deleted file mode 100644 index 07cf00a..0000000 --- a/.github/workflows/dev.yaml +++ /dev/null @@ -1,16 +0,0 @@ - -on: - workflow_dispatch: null - pull_request: - types: [opened, synchronize, labeled, unlabeled] - -env: - REGION: europe-west1 - -jobs: - deploy_to_dev: - uses: ./.github/workflows/p2p.yaml - strategy: - matrix: ${{ fromJson(vars.STAGE_DEV) }} - with: - deploy-env: ${{ matrix.deploy_env }} diff --git a/.github/workflows/envmatrix-execute-command.yaml b/.github/workflows/envmatrix-execute-command.yaml new file mode 100644 index 0000000..f1ea8ac --- /dev/null +++ b/.github/workflows/envmatrix-execute-command.yaml @@ -0,0 +1,31 @@ +on: + workflow_call: + inputs: + command: + required: true + type: string + envmatrix: + required: true + type: string + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + + +jobs: + env: + strategy: + matrix: ${{ fromJSON(inputs.envmatrix) }} + fail-fast: false + uses: ./.github/workflows/execute-command.yaml + with: + command: ${{ inputs.command }} + github_env: ${{ matrix.deploy_env }} + tag: ${{ inputs.tag }} + semver: ${{ inputs.semver }} + diff --git a/.github/workflows/execute-command.yaml b/.github/workflows/execute-command.yaml new file mode 100644 index 0000000..be35d07 --- /dev/null +++ b/.github/workflows/execute-command.yaml @@ -0,0 +1,82 @@ +on: + workflow_call: + inputs: + command: + required: true + type: string + github_env: + required: false + type: string + default: '' + dry-run: + required: false + type: boolean + default: false + region: + required: false + type: string + default: europe-west2 + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + zone: + required: false + type: string + default: europe-west2-a + pre-targets: + description: | + Make targets to run before the command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after the command + required: false + type: string + default: '' + + +jobs: + exec: + name: '${{ inputs.command }} (${{ inputs.github_env }})' + runs-on: ubuntu-latest + environment: ${{ inputs.github_env }} + env: + TAG_VERSION: ${{ inputs.tag }} + SEMVER: ${{ inputs.semver }} + REGION: ${{ inputs.region }} + REGISTRY: ${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant + SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com + WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} + BASE_URL: ${{ vars.BASE_URL }} + ENVIRONMENT: ${{ vars.ENV }} + ENV: ${{ vars.ENV }} + PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} + PROJECT_ID: ${{ vars.PROJECT_ID }} + TENANT_NAME: ${{ vars.TENANT_NAME }} + ADDITIONAL_ENV_VARS: "FOO,BAR" + steps: + - name: add_additional_env_vars + env: + ALL_VARS: ${{ toJSON(vars) }}" + run: | + echo "ALL_VARS=$ALL_VARS" + - name: print + run: | + echo "TAG_VERSION=$TAG_VERSION" + echo "SEMVER=$SEMVER" + echo "BASE_URL=$BASE_URL" + echo "PROJECT_ID=$PROJECT_ID" + echo "REGION=$REGION" + echo "SERVICE_ACCOUNT=$SERVICE_ACCOUNT" + echo "WORKLOAD_IDENTITY_PROVIDER=$WORKLOAD_IDENTITY_PROVIDER" + echo "REGISTRY=$REGISTRY" + echo "PROJECT_NUMBER=$PROJECT_NUMBER" + echo "TENANT_NAME=$TENANT_NAME" + echo "ENV=$ENVIRONMENT" diff --git a/.github/workflows/external-promote-image.yaml b/.github/workflows/external-promote-image.yaml new file mode 100644 index 0000000..6cb5e5f --- /dev/null +++ b/.github/workflows/external-promote-image.yaml @@ -0,0 +1,169 @@ +name: p2p-command + +on: + workflow_call: + secrets: + env_vars: + required: false + inputs: + promotion-stage: + required: true + type: string + dry-run: + required: false + type: boolean + default: false + source_github_env: + required: true + type: string + dest_github_env: + required: true + type: string + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + region: + required: false + type: string + default: europe-west2 + pre-targets: + description: | + Make targets to run before the command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after the command + required: false + type: string + default: '' + + +jobs: + lookup: + runs-on: ubuntu-latest + environment: ${{ inputs.source_github_env }} + env: + REGISTRY: ${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant + SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com + WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} + outputs: + source_registry: ${{ env.REGISTRY }} + source_service_account: ${{ env.SERVICE_ACCOUNT }} + source_workflow_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} + steps: + - run: echo "dummy command" + + promote-image: + name: promote-${{ inputs.promotion-stage }} + runs-on: ubuntu-latest + needs: [lookup] + environment: ${{ inputs.dest_github_env }} + env: + TAG_VERSION: ${{ inputs.tag }} + SEMVER: ${{ inputs.semver }} + SOURCE_REGISTRY: ${{ needs.lookup.outputs.source_registry }} + SOURCE_SERVICE_ACCOUNT: ${{ needs.lookup.outputs.source_service_account }} + SOURCE_WORKLOAD_IDENTITY_PROVIDER: ${{ needs.lookup.outputs.source_workflow_identity_provider }} + + REGION: ${{ inputs.region }} + REGISTRY: ${{ inputs.region }}-docker.pkg.dev/${{ vars.PROJECT_ID }}/tenant + SERVICE_ACCOUNT: p2p-${{ vars.TENANT_NAME }}@${{ vars.PROJECT_ID }}.iam.gserviceaccount.com + WORKLOAD_IDENTITY_PROVIDER: projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/p2p-${{ vars.TENANT_NAME }}/providers/p2p-${{ vars.TENANT_NAME }} + BASE_URL: ${{ vars.BASE_URL }} + ENVIRONMENT: ${{ vars.ENV }} + ENV: ${{ vars.ENV }} + PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} + PROJECT_ID: ${{ vars.PROJECT_ID }} + TENANT_NAME: ${{ vars.TENANT_NAME }} + ADDITIONAL_ENV_VARS: "FOO,BAR" + permissions: + contents: read + id-token: write + + steps: + - name: print + run: | + echo "SOURCE_GITHUB_ENV=${{ inputs.source_github_env }}" + echo "DEST_GITHUB_ENV=${{ inputs.dest_github_env }}" + yq -p=json <> $GITHUB_OUTPUT + cat $GITHUB_OUTPUT + + - name: Run Prepare Promotion + if: steps.run-check-prepare-promotion.outputs.prepare_promotion_task != '' + id: run-prepare-promotion + run: | + make p2p-prepare-promotion-${{ inputs.promotion-stage }} + + + - name: Authenticate to Google Cloud (Dest)) + id: auth-prod + if: inputs.dry-run == false && inputs.promotion-stage == 'prod' + uses: google-github-actions/auth@v1 + with: + workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ env.SERVICE_ACCOUNT }} + token_format: access_token + access_token_lifetime: 600s + + - name: Login to Artifact Registry Prod + uses: docker/login-action@v2 + if: inputs.dry-run == false && inputs.promotion-stage == 'prod' + with: + registry: europe-west2-docker.pkg.dev + username: oauth2accesstoken + password: ${{ steps.auth-prod.outputs.access_token }} + + - name: Run Promotion + id: run-promotion + run: | + make p2p-promote-${{ inputs.promotion-stage }} + \ No newline at end of file diff --git a/.github/workflows/external-workflow-exttests.yaml b/.github/workflows/external-workflow-exttests.yaml new file mode 100644 index 0000000..f69a718 --- /dev/null +++ b/.github/workflows/external-workflow-exttests.yaml @@ -0,0 +1,78 @@ + +on: + workflow_call: + inputs: + stage-dev: + required: false + type: string + default: ${{ vars.STAGE_DEV }} + dry-run: + required: false + type: boolean + default: false + image_tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + pre-targets: + description: | + Make targets to run before each p2p command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after each p2p command + required: false + type: string + default: '' + +env: + REGION: europe-west2 + +jobs: + promote-pre-extended-tests: + name: promote-extended-tests + #if: github.ref == 'refs/heads/main' + uses: ./.github/workflows/external-promote-image.yaml + with: + source_github_env: ${{ vars.PRIMARY_DEV }} + dest_github_env: ${{ vars.PRIMARY_PROD }} + promotion-stage: extended-tests + tag: ${{ inputs.image_tag }} + semver: ${{ inputs.semver }} + + + run-tests: + uses: ./.github/workflows/envmatrix-execute-command.yaml + needs: [promote-pre-extended-tests] + with: + command: p2p-extended-tests + envmatrix: ${{ vars.STAGE_DEV }} + tag: ${{ inputs.image_tag }} + semver: ${{ inputs.semver }} + + dev-deploy: + name: dev-deploy + #if: github.ref == 'refs/heads/main' + needs: [run-tests] + uses: ./.github/workflows/envmatrix-execute-command.yaml + with: + command: p2p-dev + envmatrix: ${{ inputs.stage-dev }} + tag: ${{ inputs.image_tag }} + semver: ${{ needs.version.outputs.semver }} + + promote-post-extended-tests: + uses: ./.github/workflows/external-promote-image.yaml + needs: [run-tests] + with: + source_github_env: ${{ vars.PRIMARY_DEV }} + dest_github_env: ${{ vars.PRIMARY_PROD }} + promotion-stage: prod + tag: ${{ inputs.image_tag }} + semver: ${{ inputs.semver }} diff --git a/.github/workflows/external-workflow-fastfeedback.yaml b/.github/workflows/external-workflow-fastfeedback.yaml new file mode 100644 index 0000000..800bf04 --- /dev/null +++ b/.github/workflows/external-workflow-fastfeedback.yaml @@ -0,0 +1,111 @@ +run-name: boom + +on: + workflow_call: + inputs: + stage-dev: + required: false + type: string + default: ${{ vars.STAGE_DEV }} + dry-run: + required: false + type: boolean + default: false + pre-targets: + description: | + Make targets to run before each p2p command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after each p2p command + required: false + type: string + default: '' + outputs: + image_tag: + value: ${{ jobs.version.outputs.image_tag }} + semver: + value: ${{ jobs.version.outputs.semver }} + +env: + REGION: europe-west2 + +jobs: + version: + runs-on: ubuntu-latest + env: + GETME: ${{ vars.GETME || 'default' }} + USE_SEMVER_AS_IMAGE_TAG: true + outputs: + image_tag: ${{ steps.version.outputs.image_tag }} + semver: ${{ steps.version.outputs.semver }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # fetch-tags is currently broken so we need fetch them manually in the + # next step + fetch-tags: true + + - name: Get version + id: version + shell: bash + run: | + echo "GETME=$GETME" + git fetch --prune --unshallow --tags + DESCRIBE="$(git describe --match 'prefix_*' --abbrev=7)" + CLEANED_DESCRIBE="$(echo $DESCRIBE | tr '-' '.')" + IMAGE_TAG="$(echo $DESCRIBE | sed 's/prefix_/v/')" + SEMVER="${CLEANED_DESCRIBE:7:-9}" + echo "DESCRIBE=$DESCRIBE CLEANED_DESCRIBE=$CLEANED_DESCRIBE" + echo "IMAGE_TAG=$IMAGE_TAG SEMVER=$SEMVER" + echo "semver=$SEMVER" >> $GITHUB_OUTPUT + if [[ "$USE_SEMVER_AS_IMAGE_TAG" == "true" ]]; then + echo "image_tag=$SEMVER" >> $GITHUB_OUTPUT + else + echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT + fi + + build: + name: build + needs: [version] + uses: ./.github/workflows/execute-command.yaml + strategy: + matrix: ${{ fromJSON(inputs.stage-dev) }} + fail-fast: false + with: + command: p2p-build + github_env: ${{ matrix.deploy_env }} + tag: ${{ needs.version.outputs.image_tag }} + semver: ${{ needs.version.outputs.semver }} + + functional-test: + name: functional-test + needs: [version, build] + uses: ./.github/workflows/execute-command.yaml + strategy: + matrix: ${{ fromJSON(inputs.stage-dev) }} + fail-fast: false + with: + command: p2p-functional + github_env: ${{ matrix.deploy_env }} + tag: ${{ needs.version.outputs.image_tag }} + semver: ${{ needs.version.outputs.semver }} + + + nft-test: + needs: [version, functional-test] + uses: ./.github/workflows/execute-command.yaml + strategy: + matrix: ${{ fromJSON(inputs.stage-dev) }} + fail-fast: false + with: + command: p2p-nft + github_env: ${{ matrix.deploy_env }} + tag: ${{ needs.version.outputs.image_tag }} + semver: ${{ needs.version.outputs.semver }} + + + diff --git a/.github/workflows/external-workflow-prod.yaml b/.github/workflows/external-workflow-prod.yaml new file mode 100644 index 0000000..5b594a3 --- /dev/null +++ b/.github/workflows/external-workflow-prod.yaml @@ -0,0 +1,46 @@ + +on: + workflow_call: + secrets: + env_vars: + required: false + inputs: + stage-prod: + required: false + type: string + default: ${{ vars.STAGE_PROD }} + dry-run: + required: false + type: boolean + default: false + tag: + required: false + type: string + default: '' + semver: + required: false + type: string + default: '' + pre-targets: + description: | + Make targets to run before each p2p command + required: false + type: string + default: '' + post-targets: + description: | + Make targets to run after each p2p command + required: false + type: string + default: '' + +jobs: + prod-deploy: + name: prod-deploy + #if: github.ref == 'refs/heads/main' + uses: ./.github/workflows/envmatrix-execute-command.yaml + with: + command: p2p-prod + envmatrix: ${{ inputs.stage-prod }} + + diff --git a/.github/workflows/p2p-dispatch.yaml b/.github/workflows/p2p-dispatch.yaml new file mode 100644 index 0000000..9cffc31 --- /dev/null +++ b/.github/workflows/p2p-dispatch.yaml @@ -0,0 +1,25 @@ + +on: + workflow_dispatch: + inputs: + stage-dev: + required: true + type: string + runsteps: + required: false + type: string + default: 'fastfeedback,extendedtests,prod' +permissions: + contents: read + id-token: write + +jobs: + fastfeedback: + if: contains(github.event.inputs.runsteps, 'fastfeedback') + uses: ./.github/workflows/external-workflow-fastfeedback.yaml +# extendedtests: +# uses: ./.github/workflows/p2p-workflow-definition.yaml +# if: contains(github.event.inputs.runsteps, 'extendedtests') +# prod: +# uses: ./.github/workflows/p2p-workflow-definition.yaml +# if: contains(github.event.inputs.runsteps, 'extendedtests') diff --git a/package.json b/package.json new file mode 100644 index 0000000..7b27122 --- /dev/null +++ b/package.json @@ -0,0 +1,241 @@ +{ + "name": "ecosystem-ui", + "version": "1.3.24", + "private": true, + "scripts": { + "build": "webpack", + "build:production": "webpack --mode=production", + "ci:prod": "yarn test && yarn build:production", + "clean": "rm -rf dist-* dist", + "clean:all": "rm -rf dist-* dist node_modules reports .cache", + "start": "webpack serve", + "start:test": "webpack-dev-server --env=integration", + "lint": "yarn lint:scss && yarn lint:ts", + "lint:fix": "yarn lint:scss:fix && yarn lint:ts:fix", + "lint:ts": "yarn lint:ts:cmd --ext ts,tsx,js,jsx .", + "lint:ts:cmd": "eslint --cache --cache-location .cache/.eslintcache", + "lint:ts:fix": "yarn lint:ts --fix", + "lint:scss": "yarn lint:scss:cmd src", + "lint:scss:cmd": "stylelint --cache --cache-location .cache/.stylelintcache", + "lint:scss:fix": "yarn lint:scss:cmd --fix src", + "test": "NODE_OPTIONS=\"--unhandled-rejections=strict\" && jest --coverage --maxWorkers=25%", + "test:flaky": "NODE_OPTIONS=\"--unhandled-rejections=strict\" && jest --config ./jest.flaky.config.js --maxWorkers=75% --passWithNoTests", + "test:ui-compliance": "NODE_OPTIONS=\"--unhandled-rejections=strict\" && jest --group=ui-compliance --maxWorkers=25%", + "test:no-cache": "yarn test --clearCache && yarn test", + "test:integration": "cypress run -c integrationFolder=cypress/integration/$TEST_DIR --browser chrome --headless", + "test:integration:ci": "./scripts/runCypressInCi.sh test:integration .", + "test:integration:open": "cypress open -c integrationFolder=cypress/integration/$TEST_DIR", + "test:integration:local:ci": "CYPRESS_OVERRIDE_IMPORTMAP='true' cypress run -c integrationFolder=cypress/integration/$TEST_DIR --browser chrome --headless", + "test:integration:local:open": "CYPRESS_OVERRIDE_IMPORTMAP='true' cypress open -c integrationFolder=cypress/integration/$TEST_DIR", + "cypress": "cypress open", + "test:system": "cypress run -c integrationFolder=cypress/system", + "test:system:ci": "./scripts/waitForServicesUp.sh && cypress run -c integrationFolder=cypress/system/$TEST_DIR --browser chrome --headless", + "test:system:open": "cypress open -c integrationFolder=cypress/system/$TEST_DIR", + "test:unit:duration:sorted:csv": "junit2json ./reports/coverage/junit.xml > ./reports/coverage/uiUnitTestsResults.json && ts-node ./scripts/createLiteSortedUiUnitTestsDurationJson.ts && json2csv -i ./reports/coverage/liteSortedUiUnitTestsDuration.json -o ./reports/coverage/liteSortedUiUnitTestsDuration.csv -p --unwind", + "cy:reports:aggregate": "mochawesome-merge ./reports/cypress/results/* > ./reports/cypress/results/cypress-report.json", + "cy:reports:html": "marge --reportDir reports/cypress/results/ --cdn true --charts true reports/cypress/results/cypress-report.json", + "cy:reports:generate": "yarn cy:reports:aggregate && yarn cy:reports:html", + "report": "open ./reports/coverage/lcov-report/index.html", + "test:integration:ci:docker": "./scripts/runCypressInDocker.sh test:integration .", + "typecheck": "bash -c 'tsc --noEmit'", + "typecheck:cmd": "yarn typecheck && yarn typecheck:cypress", + "typecheck:cypress": "tsc --noEmit --project ./cypress/tsconfig.json", + "sonar": "sonar-scanner" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all", + "not ie > 1", + "not ie_mob > 1" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "dependencies": { + "@apollo/client": "^3.1.4", + "@babel/helper-call-delegate": "^7.12.13", + "@ecosystem/brand-manager-pkg": "7.29.3", + "@ecosystem/brands-api": "1.33.0", + "@ecosystem/export-api": "^1.16.0", + "@ecosystem/export-utils": "1.1.0", + "@ecosystem/formatters": "2.0.0", + "@ecosystem/market-context-selection": "1.0.247", + "@ecosystem/newron-client-lib": "1.43.17", + "@ecosystem/newron-design-system": "1.27.61", + "@ecosystem/performance-drivers": "1.20.5", + "@ecosystem/preference-nest-api": "2.6.14", + "@ecosystem/ui-lib": "11.8.1", + "@ecosystem/upsell-modules": "2.2.0", + "@fortawesome/fontawesome-svg-core": "^1.2.22", + "@fortawesome/free-solid-svg-icons": "^5.10.2", + "@fortawesome/react-fontawesome": "^0.1.4", + "@segment/in-eu": "^0.3.0", + "apollo-client": "^2.6.4", + "autobind": "^1.0.3", + "axios": "^0.19.0", + "connected-react-router": "6.4.0", + "core-js": "3.2.1", + "currency-symbol-map": "^5.1.0", + "cypress-grep": "^2.13.1", + "cypress-real-events": "^1.4.0", + "date-fns": "^2.3.0", + "debounce": "^1.2.0", + "ecosystem-api": "*", + "file-saver": "^2.0.5", + "graphql": "15.5", + "highcharts": "^9.3.2", + "highcharts-react-official": "^3.0.0", + "history": "^4.9.0", + "intro.js": "^6.0.0", + "intro.js-react": "^0.7.0", + "jest-runner-groups": "^2.1.0", + "json2csv": "^5.0.7", + "junit2json": "^3.0.0", + "jwt-decode": "^3.1.2", + "moment": "^2.24.0", + "nock": "^13.2.1", + "normalize.css": "^8.0.1", + "query-string": "^6.13.2", + "react": "^16.14.0", + "react-apollo": "^2.5.6", + "react-dom": "npm:@hot-loader/react-dom", + "react-hot-loader": "^4.12.12", + "react-outside-click-handler": "^1.3.0", + "react-query": "^3.24.4", + "react-redux": "^7.2.8", + "react-router-dom": "^5.2.0", + "react-select": "4.3.1", + "recharts": "^1.7.1", + "redux": "^4.0.4", + "redux-localstorage": "^v1.0.0-rc4", + "redux-localstorage-filter": "^0.1.1", + "redux-thunk": "^2.3.0", + "reselect": "^4.1.5", + "sanitize-html": "^1.27.0", + "ts-node": "^10.7.0", + "ulid": "^2.3.0", + "use-query-params": "^1.2.3" + }, + "devDependencies": { + "@babel/core": "^7.12.9", + "@babel/plugin-proposal-class-properties": "^7.5.5", + "@babel/plugin-proposal-decorators": "^7.6.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1", + "@babel/plugin-proposal-object-rest-spread": "^7.5.5", + "@babel/plugin-proposal-optional-chaining": "^7.9.0", + "@babel/plugin-syntax-import-meta": "^7.2.0", + "@babel/plugin-transform-runtime": "^7.13.15", + "@babel/polyfill": "^7.6.0", + "@babel/preset-env": "^7.12.7", + "@babel/preset-react": "^7.12.7", + "@babel/preset-typescript": "^7.12.7", + "@babel/register": "^7.6.0", + "@svgr/webpack": "5.5.0", + "@testing-library/dom": "^7.28.1", + "@testing-library/jest-dom": "^5.11.6", + "@testing-library/react": "^11.0.4", + "@testing-library/react-hooks": "^3.4.1", + "@testing-library/user-event": "^12.2.2", + "@types/classnames": "^2.2.9", + "@types/dateformat": "^3.0.1", + "@types/debounce": "^1.2.0", + "@types/dotenv": "^6.1.1", + "@types/file-saver": "^2.0.1", + "@types/graphql": "^14.5.0", + "@types/history": "^4.7.3", + "@types/intro.js": "^5.1.0", + "@types/jest": "^26.0.0", + "@types/jest-when": "2.7.2", + "@types/jwt-decode": "^2.2.1", + "@types/node": "12.7.4", + "@types/react": "^17.0.4", + "@types/react-intl": "^3.0.0", + "@types/react-outside-click-handler": "^1.3.0", + "@types/react-redux": "^7.1.2", + "@types/react-router-dom": "^5.3.3", + "@types/react-select": "3.0.8", + "@types/react-test-renderer": "^16.9.0", + "@types/recharts": "^1.1.21", + "@types/redux": "^3.6.0", + "@types/redux-localstorage": "^1.0.8", + "@types/redux-localstorage-filter": "^0.1.4", + "@types/sanitize-html": "^1.23.3", + "@types/systemjs": "^6.1.0", + "@types/webpack-env": "^1.16.0", + "awesome-typescript-loader": "^5.2.1", + "babel-core": "^7.0.0-bridge.0", + "babel-loader": "^8.0.6", + "body-parser": "^1.19.0", + "classnames": "^2.2.6", + "clean-webpack-plugin": "^3.0.0", + "cross-env": "^7.0.3", + "css-loader": "^3.2.0", + "cypress": "9.6.0", + "cypress-localstorage-commands": "^1.7.0", + "cypress-multi-reporters": "^1.5.0", + "cypress-xpath": "^1.4.0", + "dateformat": "^3.0.3", + "dotenv": "^8.1.0", + "dotenv-defaults": "^1.1.1", + "dotenv-webpack": "^1.7.0", + "exceljs": "^4.2.1", + "express": "^4.17.1", + "file-loader": "^6.2.0", + "identity-obj-proxy": "^3.0.0", + "jest": "^26.6.1", + "jest-chance": "^0.1.7", + "jest-junit": "^8.0.0", + "jest-localstorage-mock": "^2.4.0", + "jest-raw-loader": "^1.0.1", + "jest-when": "^3.0.1", + "jwt-decode": "^3.1.2", + "mini-css-extract-plugin": "^1.6.0", + "mocha": "^9.2.2", + "mochawesome": "^7.1.3", + "mochawesome-merge": "^4.2.1", + "mochawesome-report-generator": "^6.2.0", + "mock-apollo-client": "^1.0.0", + "msw": "^0.39.2", + "node-sass": "^6.0.1", + "optimize-css-assets-webpack-plugin": "^5.0.3", + "postcss-loader": "^3.0.0", + "postcss-preset-env": "^6.7.0", + "prettier": "^2.8.4", + "process": "^0.11.10", + "raw-loader": "^3.1.0", + "react-select-event": "^5.1.0", + "react-test-renderer": "^16.9.0", + "redux-devtools-extension": "^2.13.8", + "sass-loader": "^12.3.0", + "single-spa-css": "^1.1.2", + "single-spa-react": "^4.1.1", + "style-loader": "^0.23.1", + "stylelint": "^13.2.0", + "stylelint-declaration-use-variable": "^1.7.2", + "stylelint-order": "^3.1.0", + "stylelint-scss": "^3.10.1", + "stylelint-webpack-plugin": "^2.0.0", + "ts-config-single-spa": "^2.0.1", + "ts-jest": "^26.5.6", + "ts-loader": "^6.0.4", + "typescript": "4.8.4", + "url-loader": "^2.1.0", + "webpack": "^5.8.0", + "webpack-cli": "^4.2.0", + "webpack-config-single-spa-react": "2.2.2", + "webpack-config-single-spa-react-ts": "2.2.2", + "webpack-config-single-spa-ts": "^3.0.0", + "webpack-dev-server": "^4.0.0-beta.3", + "webpack-graphql-loader": "^1.0.2", + "webpack-merge": "^5.4.0", + "webpack-modules": "^1.0.0", + "whatwg-fetch": "^3.6.2", + "write-pkg": "^4.0.0", + "yarn": "^1.17.3" + } +} diff --git a/.github/workflows/dev-dispatch.yaml b/scratch/dev-dispatch.yaml similarity index 100% rename from .github/workflows/dev-dispatch.yaml rename to scratch/dev-dispatch.yaml diff --git a/scratch/dev.yaml b/scratch/dev.yaml new file mode 100644 index 0000000..8d43daf --- /dev/null +++ b/scratch/dev.yaml @@ -0,0 +1,27 @@ + +on: + workflow_dispatch: null + pull_request: + types: [opened, synchronize, labeled, unlabeled] + +jobs: + + version: + runs-on: ubuntu-latest + env: + USE_SEMVER_AS_IMAGE_TAG: true + FOO: ${{ var.STAGE_DEV }} + steps: + - name: Get version + id: version + shell: bash + run: | + echo "STAGE_DEV=$STAGE_DEV" + + +# fastfeedback: +# uses: ./.github/workflows/p2p-workflow-definition.yaml +# extendedtests: +# uses: ./.github/workflows/p2p-workflow-definition.yaml +# prod: +# uses: ./.github/workflows/p2p-workflow-definition.yaml \ No newline at end of file diff --git a/.github/workflows/p2p.yaml b/scratch/p2p.yaml similarity index 100% rename from .github/workflows/p2p.yaml rename to scratch/p2p.yaml