ci: Update e2e (#382)

* Update

* Fix

* Fix

* Typo

* Cleanup

* Run on merge to master

* Fix branch name
This commit is contained in:
Anatolios Laskaris 2022-11-22 16:58:30 +02:00 committed by GitHub
parent c33d46619d
commit f5de602108
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 68 deletions

View File

@ -4,22 +4,23 @@ on:
pull_request: pull_request:
paths-ignore: paths-ignore:
- "!**.md" - "!**.md"
push:
branches:
- "master"
concurrency: concurrency:
group: "${{ github.workflow }}-${{ github.ref }}" group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
snapshot: aquavm:
name: "aquavm"
uses: ./.github/workflows/snapshot.yml uses: ./.github/workflows/snapshot.yml
with: with:
ref: ${{ github.ref }} ref: ${{ github.ref }}
rust-peer: rust-peer:
name: "rust-peer"
needs: needs:
- snapshot - aquavm
uses: fluencelabs/rust-peer/.github/workflows/snapshot.yml@master uses: fluencelabs/rust-peer/.github/workflows/snapshot.yml@master
with: with:
@ -28,12 +29,12 @@ jobs:
[ [
{ {
"package": "avm-server", "package": "avm-server",
"version": "=${{ needs.snapshot.outputs.cargo-version }}", "version": "=${{ needs.aquavm.outputs.cargo-version }}",
"registry": "fluence" "registry": "fluence"
}, },
{ {
"package": "air-interpreter-wasm", "package": "air-interpreter-wasm",
"version": "=${{ needs.snapshot.outputs.cargo-version }}", "version": "=${{ needs.aquavm.outputs.cargo-version }}",
"registry": "fluence" "registry": "fluence"
} }
] ]
@ -41,50 +42,48 @@ jobs:
fluence-js-tests: fluence-js-tests:
name: "fluence-js" name: "fluence-js"
needs: needs:
- snapshot - aquavm
- rust-peer - rust-peer
uses: fluencelabs/fluence-js/.github/workflows/tests.yml@master uses: fluencelabs/fluence-js/.github/workflows/tests.yml@master
with: with:
avm-version: "${{ needs.snapshot.outputs.avm-version }}" avm-version: "${{ needs.aquavm.outputs.avm-version }}"
rust-peer-image: "${{ needs.rust-peer.outputs.rust-peer-image }}" rust-peer-image: "${{ needs.rust-peer.outputs.rust-peer-image }}"
fluence-js-snapshot: fluence-js:
name: "fluence-js"
needs: needs:
- snapshot - aquavm
uses: fluencelabs/fluence-js/.github/workflows/snapshot.yml@master uses: fluencelabs/fluence-js/.github/workflows/snapshot.yml@master
with: with:
avm-version: "${{ needs.snapshot.outputs.avm-version }}" avm-version: "${{ needs.aquavm.outputs.avm-version }}"
aqua-snapshot: aqua:
name: "aqua"
needs: needs:
- fluence-js-snapshot - fluence-js
uses: fluencelabs/aqua/.github/workflows/snapshot.yml@main uses: fluencelabs/aqua/.github/workflows/snapshot.yml@main
with: with:
fluence-js-version: "${{ needs.fluence-js-snapshot.outputs.fluence-js-version }}" fluence-js-version: "${{ needs.fluence-js.outputs.fluence-js-version }}"
aqua-playground: aqua-playground:
needs: needs:
- fluence-js-snapshot - fluence-js
- aqua-snapshot - aqua
- rust-peer - rust-peer
uses: fluencelabs/aqua-playground/.github/workflows/tests.yml@master uses: fluencelabs/aqua-playground/.github/workflows/tests.yml@master
with: with:
fluence-js-version: "${{ needs.fluence-js-snapshot.outputs.fluence-js-version }}" fluence-js-version: "${{ needs.fluence-js.outputs.fluence-js-version }}"
aqua-version: "${{ needs.aqua-snapshot.outputs.aqua-version }}" aqua-version: "${{ needs.aqua.outputs.aqua-version }}"
rust-peer-image: "${{ needs.rust-peer.outputs.rust-peer-image }}" rust-peer-image: "${{ needs.rust-peer.outputs.rust-peer-image }}"
registry: registry:
needs: needs:
- aqua-snapshot - aqua
- rust-peer - rust-peer
uses: fluencelabs/registry/.github/workflows/tests.yml@main uses: fluencelabs/registry/.github/workflows/tests.yml@main
with: with:
aqua-version: "${{ needs.aqua-snapshot.outputs.aqua-version }}" aqua-version: "${{ needs.aqua.outputs.aqua-version }}"
rust-peer-image: "${{ needs.rust-peer.outputs.rust-peer-image }}" rust-peer-image: "${{ needs.rust-peer.outputs.rust-peer-image }}"

View File

@ -108,9 +108,15 @@ jobs:
run: | run: |
sed -i '/members/a "crates/interpreter-wasm",' Cargo.toml sed -i '/members/a "crates/interpreter-wasm",' Cargo.toml
- name: Generate snapshot version
id: version
uses: fluencelabs/github-actions/generate-snapshot-id@main
- name: Publish crate snapshots - name: Publish crate snapshots
id: snapshot id: snapshot
uses: fluencelabs/github-actions/cargo-publish-snapshot@main uses: fluencelabs/github-actions/cargo-publish-snapshot@main
with:
id: ${{ steps.version.outputs.id }}
publish-avm: publish-avm:
name: "Publish @fluencelabs/avm snapshot" name: "Publish @fluencelabs/avm snapshot"
@ -119,7 +125,7 @@ jobs:
needs: wasm needs: wasm
outputs: outputs:
version: "${{ steps.build.outputs.version }}" version: "${{ steps.snaphot.outputs.version }}"
permissions: permissions:
contents: read contents: read
@ -168,37 +174,23 @@ jobs:
- run: npm run build - run: npm run build
working-directory: avm/client working-directory: avm/client
- name: Generate package version - name: Generate snapshot version
id: version id: version
run: | uses: fluencelabs/github-actions/generate-snapshot-id@main
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 - name: Publish snapshot
id: build id: snapshot
env: uses: fluencelabs/github-actions/npm-publish-snapshot@main
BRANCH: ${{ steps.version.outputs.branch }} with:
SHA: ${{ steps.version.outputs.sha }} working-directory: avm/client
RUN: ${{ github.run_number }} id: ${{ steps.version.outputs.id }}
ATTEMPT: ${{ github.run_attempt }}
working-directory: avm/client
run: |
echo "::set-output name=version::$(\
npm version prerelease \
--no-git-tag-version \
--preid ${{ env.BRANCH }}-${{ env.SHA }}-${{ env.RUN }}-${{ env.ATTEMPT }})"
- name: Publish to self-hosted npm repo
working-directory: avm/client
run: npm publish --tag snapshot --registry https://npm.fluence.dev
publish-air-beautify: publish-air-beautify:
name: "Publish air-beautify-wasm snapshot" name: "Publish air-beautify-wasm snapshot"
runs-on: builder runs-on: builder
outputs: outputs:
version: "${{ steps.build.outputs.version }}" version: "${{ steps.snapshot.outputs.version }}"
permissions: permissions:
contents: read contents: read
@ -242,27 +234,13 @@ jobs:
wasm-pack build --release wasm-pack build --release
working-directory: tools/wasm/air-beautify-wasm working-directory: tools/wasm/air-beautify-wasm
- name: Generate package version - name: Generate snapshot version
id: version id: version
run: | uses: fluencelabs/github-actions/generate-snapshot-id@main
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 - name: Publish snapshot
id: build id: snapshot
env: uses: fluencelabs/github-actions/npm-publish-snapshot@main
BRANCH: ${{ steps.version.outputs.branch }} with:
SHA: ${{ steps.version.outputs.sha }} working-directory: tools/wasm/air-beautify-wasm/pkg
RUN: ${{ github.run_number }} id: ${{ steps.version.outputs.id }}
ATTEMPT: ${{ github.run_attempt }}
working-directory: tools/wasm/air-beautify-wasm/pkg
run: |
echo "::set-output name=version::$(\
npm version prerelease \
--no-git-tag-version \
--preid ${{ env.BRANCH }}-${{ env.SHA }}-${{ env.RUN }}-${{ env.ATTEMPT }})"
- name: Publish to self-hosted npm repo
working-directory: tools/wasm/air-beautify-wasm/pkg
run: npm publish --tag snapshot --registry https://npm.fluence.dev