chore: Small E2E tuning (#184)

* Make comment a step instead of a job

To save space on summary screen of github actions

* Build aqua with fluence-js snapshot

* Typo

* Another typo

* Use short sha from branch

* Fix permissions?

* Fix

* Install then set version

* Better names

* Even better names
This commit is contained in:
Anatoly Laskaris 2022-09-14 17:43:17 +03:00 committed by GitHub
parent 73bce39621
commit 3b05852a65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 18 deletions

View File

@ -14,10 +14,24 @@ jobs:
uses: ./.github/workflows/tests.yml
snapshot:
name: "fluence-js"
uses: ./.github/workflows/snapshot.yml
aqua-snapshot:
name: "aqua"
needs:
- snapshot
uses: fluencelabs/aqua/.github/workflows/snapshot.yml@main
with:
fluence-js-version: ${{ needs.snapshot.outputs.fluence-js-version }}
aqua-playground:
needs: snapshot
needs:
- snapshot
- aqua-snapshot
uses: fluencelabs/aqua-playground/.github/workflows/tests.yml@master
with:
fluence-js-version: ${{ needs.snapshot.outputs.fluence-js-version }}
aqua-version: ${{ needs.aqua-snapshot.outputs.aqua-version }}

View File

@ -25,6 +25,7 @@ jobs:
permissions:
contents: read
pull-requests: write
id-token: write
steps:
@ -44,12 +45,13 @@ jobs:
registry-url: "https://npm.fluence.dev"
cache: "pnpm"
- run: pnpm i
- name: Set avm version from branch
if: inputs.avm-version != ''
working-directory: packages/fluence-js
run: pnpm add @fluencelabs/avm@${{ inputs.avm-version }}
- run: pnpm i
- run: pnpm -r build
- name: Import secrets
@ -68,9 +70,8 @@ jobs:
- name: Generate package version
id: version
run: |
SHA=$(git rev-parse --short HEAD)
echo "::set-output name=sha::$SHA"
SHA=${{ github.event.pull_request.head.sha }}
echo "::set-output name=sha::${SHA::7}"
echo "::set-output name=branch::${GITHUB_HEAD_REF//[^a-zA-Z0-9-]/-}"
- name: Set package version
@ -87,18 +88,7 @@ jobs:
- name: Publish to self-hosted npm repo
run: pnpm --no-git-checks --registry https://npm.fluence.dev -r publish --tag e2e -filter '@fluencelabs/*'
comment:
name: "Update comment"
runs-on: ubuntu-latest
needs:
- publish-snapshot
env:
FLUENCE_JS_VERSION: ${{ needs.publish-snapshot.outputs.fluence-js-version }}
steps:
- name: Find comment
- name: Find comment in PR
uses: peter-evans/find-comment@v1
id: comment
with:
@ -106,8 +96,10 @@ jobs:
comment-author: github-actions[bot]
body-includes: "## FluenceJS version is"
- name: Update comment
- name: Update comment in PR
uses: peter-evans/create-or-update-comment@v1
env:
FLUENCE_JS_VERSION: ${{ steps.build.outputs.version }}
with:
comment-id: "${{ steps.comment.outputs.comment-id }}"
issue-number: "${{ github.event.pull_request.number }}"