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

View File

@ -108,9 +108,15 @@ jobs:
run: |
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
id: snapshot
uses: fluencelabs/github-actions/cargo-publish-snapshot@main
with:
id: ${{ steps.version.outputs.id }}
publish-avm:
name: "Publish @fluencelabs/avm snapshot"
@ -119,7 +125,7 @@ jobs:
needs: wasm
outputs:
version: "${{ steps.build.outputs.version }}"
version: "${{ steps.snaphot.outputs.version }}"
permissions:
contents: read
@ -168,37 +174,23 @@ jobs:
- run: npm run build
working-directory: avm/client
- name: Generate package version
- name: Generate snapshot version
id: version
run: |
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-]/-}"
uses: fluencelabs/github-actions/generate-snapshot-id@main
- 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 }}
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
- name: Publish snapshot
id: snapshot
uses: fluencelabs/github-actions/npm-publish-snapshot@main
with:
working-directory: avm/client
id: ${{ steps.version.outputs.id }}
publish-air-beautify:
name: "Publish air-beautify-wasm snapshot"
runs-on: builder
outputs:
version: "${{ steps.build.outputs.version }}"
version: "${{ steps.snapshot.outputs.version }}"
permissions:
contents: read
@ -242,27 +234,13 @@ jobs:
wasm-pack build --release
working-directory: tools/wasm/air-beautify-wasm
- name: Generate package version
- name: Generate snapshot version
id: version
run: |
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-]/-}"
uses: fluencelabs/github-actions/generate-snapshot-id@main
- 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 }}
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
- name: Publish snapshot
id: snapshot
uses: fluencelabs/github-actions/npm-publish-snapshot@main
with:
working-directory: tools/wasm/air-beautify-wasm/pkg
id: ${{ steps.version.outputs.id }}