mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-04-25 01:42:13 +00:00
ci: Update e2e (#203)
* Test * Fix * Fix * Fix name * Update * Update actions * Use main branch * Fix
This commit is contained in:
parent
a6903759e2
commit
1506c7cf16
@ -1,45 +1,47 @@
|
|||||||
name: Run tests
|
name: "e2e"
|
||||||
|
|
||||||
on:
|
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:
|
||||||
fluence-js:
|
tests:
|
||||||
|
name: "fluence-js"
|
||||||
uses: ./.github/workflows/tests.yml
|
uses: ./.github/workflows/tests.yml
|
||||||
|
|
||||||
snapshot:
|
fluence-js:
|
||||||
name: "fluence-js"
|
|
||||||
uses: ./.github/workflows/snapshot.yml
|
uses: ./.github/workflows/snapshot.yml
|
||||||
|
|
||||||
aqua-snapshot:
|
aqua:
|
||||||
name: "aqua"
|
|
||||||
needs:
|
needs:
|
||||||
- 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.snapshot.outputs.fluence-js-version }}"
|
fluence-js-version: "${{ needs.fluence-js.outputs.fluence-js-version }}"
|
||||||
|
|
||||||
aqua-playground:
|
aqua-playground:
|
||||||
needs:
|
needs:
|
||||||
- snapshot
|
- fluence-js
|
||||||
- aqua-snapshot
|
- aqua
|
||||||
|
|
||||||
uses: fluencelabs/aqua-playground/.github/workflows/tests.yml@master
|
uses: fluencelabs/aqua-playground/.github/workflows/tests.yml@master
|
||||||
with:
|
with:
|
||||||
fluence-js-version: "=${{ needs.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 }}"
|
||||||
|
|
||||||
registry:
|
registry:
|
||||||
needs:
|
needs:
|
||||||
- aqua-snapshot
|
- aqua
|
||||||
|
|
||||||
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 }}"
|
57
.github/workflows/snapshot.yml
vendored
57
.github/workflows/snapshot.yml
vendored
@ -21,11 +21,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
fluence-js-version: "${{ steps.build.outputs.version }}"
|
fluence-js-version: "${{ steps.snapshot.outputs.version }}"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -34,7 +33,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repository: fluencelabs/fluence-js
|
repository: fluencelabs/fluence-js
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2.2.2
|
- uses: pnpm/action-setup@v2.2.4
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 7
|
||||||
|
|
||||||
@ -47,15 +46,16 @@ jobs:
|
|||||||
|
|
||||||
- run: pnpm i
|
- run: pnpm i
|
||||||
|
|
||||||
- name: Set avm version from branch
|
- name: Set avm version
|
||||||
if: inputs.avm-version != ''
|
if: inputs.avm-version != ''
|
||||||
working-directory: packages/fluence-js
|
uses: fluencelabs/github-actions/npm-set-dependency@main
|
||||||
run: pnpm add --save -E @fluencelabs/avm@${{ inputs.avm-version }}
|
with:
|
||||||
|
package: "@fluencelabs/avm"
|
||||||
- run: pnpm -r build
|
version: ${{ inputs.avm-version }}
|
||||||
|
working-directory: packages/fluence-js
|
||||||
|
|
||||||
- name: Import secrets
|
- name: Import secrets
|
||||||
uses: hashicorp/vault-action@v2.4.2
|
uses: hashicorp/vault-action@v2.4.3
|
||||||
with:
|
with:
|
||||||
url: https://vault.fluence.dev
|
url: https://vault.fluence.dev
|
||||||
path: jwt/github
|
path: jwt/github
|
||||||
@ -67,35 +67,26 @@ jobs:
|
|||||||
secrets: |
|
secrets: |
|
||||||
kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN
|
kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN
|
||||||
|
|
||||||
- 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 "sha=${SHA::7}" >> $GITHUB_OUTPUT
|
|
||||||
echo "branch=${GITHUB_HEAD_REF//[^a-zA-Z0-9-]/-}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Set package version
|
- name: Set package version
|
||||||
id: build
|
id: snapshot
|
||||||
env:
|
|
||||||
BRANCH: ${{ steps.version.outputs.branch }}
|
|
||||||
SHA: ${{ steps.version.outputs.sha }}
|
|
||||||
RUN: ${{ github.run_number }}
|
|
||||||
ATTEMPT: ${{ github.run_attempt }}
|
|
||||||
run: |
|
run: |
|
||||||
node ci.js bump-version ${{ env.BRANCH }}-${{ env.SHA }}-${{ env.RUN }}-${{ env.ATTEMPT }}
|
node ci.js bump-version ${{ steps.version.outputs.id }}
|
||||||
echo "version=$(node ci.js get-version)" >> $GITHUB_OUTPUT
|
echo "version=$(node ci.js get-version)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Publish to self-hosted npm repo
|
- run: pnpm -r build
|
||||||
run: pnpm --no-git-checks --registry https://npm.fluence.dev -r publish --tag e2e -filter '@fluencelabs/*'
|
|
||||||
|
|
||||||
- name: Print versions to check summary
|
- name: Publish to self-hosted npm repo
|
||||||
env:
|
|
||||||
VERSION: ${{ steps.build.outputs.version }}
|
|
||||||
run: |
|
run: |
|
||||||
cat <<'SNAPSHOT' >> $GITHUB_STEP_SUMMARY
|
# Publish to self-hosted npm repo
|
||||||
## FluenceJS version is [${{ env.VERSION }}](https://npm.fluence.dev/-/web/detail/@fluencelabs/fluence/v/${{ env.VERSION }})
|
pnpm --no-git-checks --registry https://npm.fluence.dev -r publish --tag snapshot -filter '@fluencelabs/*'
|
||||||
To use it run:
|
|
||||||
```shell
|
- name: Print info to check summary
|
||||||
npm i -E @fluencelabs/fluence@${{ env.VERSION }} --registry=https://npm.fluence.dev
|
uses: fluencelabs/github-actions/npm-publish-snapshot@main
|
||||||
```
|
with:
|
||||||
SNAPSHOT
|
working-directory: packages/fluence-js
|
||||||
|
id: ${{ steps.version.outputs.id }}
|
||||||
|
publish: false
|
||||||
|
20
.github/workflows/tests.yml
vendored
20
.github/workflows/tests.yml
vendored
@ -33,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Import secrets
|
- name: Import secrets
|
||||||
uses: hashicorp/vault-action@v2.4.1
|
uses: hashicorp/vault-action@v2.4.3
|
||||||
with:
|
with:
|
||||||
url: https://vault.fluence.dev
|
url: https://vault.fluence.dev
|
||||||
path: jwt/github
|
path: jwt/github
|
||||||
@ -57,22 +57,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repository: fluencelabs/fluence-js
|
repository: fluencelabs/fluence-js
|
||||||
|
|
||||||
- name: Setup docker-compose
|
|
||||||
uses: KengoTODA/actions-setup-docker-compose@v1.0.9
|
|
||||||
with:
|
|
||||||
version: 'v2.10.0'
|
|
||||||
|
|
||||||
- name: Pull rust-peer image
|
- name: Pull rust-peer image
|
||||||
run: docker pull $RUST_PEER_IMAGE
|
run: docker pull $RUST_PEER_IMAGE
|
||||||
|
|
||||||
- name: Run rust-peer
|
- name: Run rust-peer
|
||||||
uses: isbang/compose-action@v1.1.0
|
uses: isbang/compose-action@v1.4.1
|
||||||
with:
|
with:
|
||||||
compose-file: ".github/e2e/docker-compose.yml"
|
compose-file: ".github/e2e/docker-compose.yml"
|
||||||
down-flags: "--volumes"
|
down-flags: "--volumes"
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v2.2.2
|
uses: pnpm/action-setup@v2.2.4
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 7
|
||||||
|
|
||||||
@ -85,10 +80,13 @@ jobs:
|
|||||||
|
|
||||||
- run: pnpm i
|
- run: pnpm i
|
||||||
|
|
||||||
- name: Set avm version from branch
|
- name: Set avm version
|
||||||
if: inputs.avm-version != ''
|
if: inputs.avm-version != ''
|
||||||
working-directory: packages/fluence-js
|
uses: fluencelabs/github-actions/npm-set-dependency@main
|
||||||
run: pnpm add --save -E @fluencelabs/avm@${{ inputs.avm-version }}
|
with:
|
||||||
|
package: "@fluencelabs/avm"
|
||||||
|
version: ${{ inputs.avm-version }}
|
||||||
|
working-directory: packages/fluence-js
|
||||||
|
|
||||||
- run: pnpm -r build
|
- run: pnpm -r build
|
||||||
- run: pnpm -r test
|
- run: pnpm -r test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user