chore: Small E2E tuning (#557)

* Make comment job a step

* Use short sha from branch

* Install then set version

* Better names
This commit is contained in:
Anatoly Laskaris 2022-09-14 17:36:16 +03:00 committed by GitHub
parent f335e1ab3f
commit 33db5c51bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 20 deletions

View File

@ -16,7 +16,7 @@ env:
jobs: jobs:
compile: compile:
name: "Compile aqua" name: "Compile"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -41,7 +41,7 @@ jobs:
path: cli/.js/target/scala-*/cli-fastopt.js path: cli/.js/target/scala-*/cli-fastopt.js
publish-snapshot: publish-snapshot:
name: "Publish aqua snapshot" name: "Publish snapshot"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: compile needs: compile
@ -51,6 +51,7 @@ jobs:
permissions: permissions:
contents: read contents: read
pull-requests: write
id-token: write id-token: write
steps: steps:
@ -87,22 +88,22 @@ jobs:
cache-dependency-path: "npm/package-lock.json" cache-dependency-path: "npm/package-lock.json"
cache: "npm" cache: "npm"
- run: npm i
working-directory: npm
- name: Set fluence-js version from branch - name: Set fluence-js version from branch
if: inputs.fluence-js-version != '' if: inputs.fluence-js-version != ''
working-directory: npm working-directory: npm
run: npm i @fluencelabs/fluence@${{ inputs.fluence-js-version }} run: npm i @fluencelabs/fluence@${{ inputs.fluence-js-version }}
- run: npm i
working-directory: npm
- run: npm run build - run: npm run build
working-directory: npm working-directory: npm
- name: Generate package version - name: Generate package version
id: version id: version
run: | run: |
SHA=$(git rev-parse --short HEAD) SHA=${{ github.event.pull_request.head.sha }}
echo "::set-output name=sha::$SHA" echo "::set-output name=sha::${SHA::7}"
echo "::set-output name=branch::${GITHUB_HEAD_REF//[^a-zA-Z0-9-]/-}" echo "::set-output name=branch::${GITHUB_HEAD_REF//[^a-zA-Z0-9-]/-}"
- name: Set package version - name: Set package version
@ -123,18 +124,7 @@ jobs:
working-directory: npm working-directory: npm
run: npm publish --tag snapshot --registry https://npm.fluence.dev run: npm publish --tag snapshot --registry https://npm.fluence.dev
comment: - name: Find comment in PR
name: "Update comment"
runs-on: ubuntu-latest
needs:
- publish-snapshot
env:
AQUA_VERSION: ${{ needs.publish-snapshot.outputs.aqua-version }}
steps:
- name: Find comment
uses: peter-evans/find-comment@v1 uses: peter-evans/find-comment@v1
id: comment id: comment
with: with:
@ -142,8 +132,10 @@ jobs:
comment-author: github-actions[bot] comment-author: github-actions[bot]
body-includes: "## Aqua version is" body-includes: "## Aqua version is"
- name: Update comment - name: Update comment in PR
uses: peter-evans/create-or-update-comment@v1 uses: peter-evans/create-or-update-comment@v1
env:
AQUA_VERSION: ${{ steps.build.outputs.version }}
with: with:
comment-id: "${{ steps.comment.outputs.comment-id }}" comment-id: "${{ steps.comment.outputs.comment-id }}"
issue-number: "${{ github.event.pull_request.number }}" issue-number: "${{ github.event.pull_request.number }}"

View File

@ -30,6 +30,7 @@ jobs:
run: sbt test run: sbt test
snapshot: snapshot:
name: "aqua"
uses: ./.github/workflows/snapshot.yml uses: ./.github/workflows/snapshot.yml
aqua-playground: aqua-playground: