diff --git a/.github/workflows/fluence_js_e2e.yml b/.github/workflows/fluence_js_e2e.yml new file mode 100644 index 000000000..2ec1ba722 --- /dev/null +++ b/.github/workflows/fluence_js_e2e.yml @@ -0,0 +1,90 @@ +name: Run e2e tests + +on: + pull_request: + paths-ignore: + - "**.md" + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +env: + FORCE_COLOR: true + +jobs: + build: + name: "Build fluence-js" + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + outputs: + fluence-js-version: "${{ steps.build.outputs.version }}" + + steps: + - uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2.2.2 + with: + version: 7 + + - name: Setup node with self-hosted npm registry + uses: actions/setup-node@v2 + with: + node-version: "16" + registry-url: "https://npm.fluence.dev" + + - run: pnpm i + - run: pnpm -r build + + - name: Import secrets + uses: hashicorp/vault-action@v2.4.2 + with: + url: https://vault.fluence.dev + path: jwt/github + role: ci + method: jwt + jwtGithubAudience: "https://github.com/fluencelabs" + jwtTtl: 300 + exportToken: false + secrets: | + kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN + + - name: Generate package version + id: version + run: | + BRANCH=${GITHUB_REF#refs/heads/} + SHA=$(git rev-parse --short HEAD) + + echo "::set-output name=sha::$SHA" + echo "::set-output name=branch::${BRANCH//[^a-zA-Z0-9-]/-}" + + - name: Set package version + id: build + env: + BRANCH: ${{ steps.version.outputs.branch }} + SHA: ${{ steps.version.outputs.sha }} + RUN: ${{ github.run_number }} + ATTEMPT: ${{ github.run_attempt }} + run: | + node ci.js bump-version ${{ env.BRANCH }}-${{ env.SHA }}-${{ env.RUN }}-${{ env.ATTEMPT }} + echo "::set-output name=version::$(node ci.js get-version)" + + - name: Publish to self-hosted npm repo + run: pnpm --no-git-checks --registry https://npm.fluence.dev -r publish --tag e2e -filter '@fluencelabs/*' + + aqua-playground: + permissions: + contents: read + id-token: write + + needs: + - build + + uses: fluencelabs/aqua-playground/.github/workflows/tests.yml@marine-e2e + with: + fluence-js-version: ${{ needs.build.outputs.fluence-js-version }} + ref: marine-e2e diff --git a/.github/workflows/publish_branch.yml b/.github/workflows/publish_branch.yml index d970f41f5..5361d266b 100644 --- a/.github/workflows/publish_branch.yml +++ b/.github/workflows/publish_branch.yml @@ -70,4 +70,3 @@ jobs: echo "" echo "echo '@fluencelabs:registry=https://npm.fluence.dev/' > .npmrc" echo "npm i @fluencelabs/fluence@${fjs_version}" -