mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-04-24 17:32:14 +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:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
fluence-js:
|
||||
tests:
|
||||
name: "fluence-js"
|
||||
uses: ./.github/workflows/tests.yml
|
||||
|
||||
snapshot:
|
||||
name: "fluence-js"
|
||||
fluence-js:
|
||||
uses: ./.github/workflows/snapshot.yml
|
||||
|
||||
aqua-snapshot:
|
||||
name: "aqua"
|
||||
aqua:
|
||||
needs:
|
||||
- snapshot
|
||||
- fluence-js
|
||||
|
||||
uses: fluencelabs/aqua/.github/workflows/snapshot.yml@main
|
||||
with:
|
||||
fluence-js-version: "=${{ needs.snapshot.outputs.fluence-js-version }}"
|
||||
fluence-js-version: "${{ needs.fluence-js.outputs.fluence-js-version }}"
|
||||
|
||||
aqua-playground:
|
||||
needs:
|
||||
- snapshot
|
||||
- aqua-snapshot
|
||||
- fluence-js
|
||||
- aqua
|
||||
|
||||
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 }}"
|
||||
fluence-js-version: "${{ needs.fluence-js.outputs.fluence-js-version }}"
|
||||
aqua-version: "${{ needs.aqua.outputs.aqua-version }}"
|
||||
|
||||
registry:
|
||||
needs:
|
||||
- aqua-snapshot
|
||||
- aqua
|
||||
|
||||
uses: fluencelabs/registry/.github/workflows/tests.yml@main
|
||||
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
|
||||
|
||||
outputs:
|
||||
fluence-js-version: "${{ steps.build.outputs.version }}"
|
||||
fluence-js-version: "${{ steps.snapshot.outputs.version }}"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
@ -34,7 +33,7 @@ jobs:
|
||||
with:
|
||||
repository: fluencelabs/fluence-js
|
||||
|
||||
- uses: pnpm/action-setup@v2.2.2
|
||||
- uses: pnpm/action-setup@v2.2.4
|
||||
with:
|
||||
version: 7
|
||||
|
||||
@ -47,15 +46,16 @@ jobs:
|
||||
|
||||
- run: pnpm i
|
||||
|
||||
- name: Set avm version from branch
|
||||
- name: Set avm version
|
||||
if: inputs.avm-version != ''
|
||||
working-directory: packages/fluence-js
|
||||
run: pnpm add --save -E @fluencelabs/avm@${{ inputs.avm-version }}
|
||||
|
||||
- run: pnpm -r build
|
||||
uses: fluencelabs/github-actions/npm-set-dependency@main
|
||||
with:
|
||||
package: "@fluencelabs/avm"
|
||||
version: ${{ inputs.avm-version }}
|
||||
working-directory: packages/fluence-js
|
||||
|
||||
- name: Import secrets
|
||||
uses: hashicorp/vault-action@v2.4.2
|
||||
uses: hashicorp/vault-action@v2.4.3
|
||||
with:
|
||||
url: https://vault.fluence.dev
|
||||
path: jwt/github
|
||||
@ -67,35 +67,26 @@ jobs:
|
||||
secrets: |
|
||||
kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN
|
||||
|
||||
- name: Generate package version
|
||||
- name: Generate snapshot version
|
||||
id: version
|
||||
run: |
|
||||
SHA=${{ github.event.pull_request.head.sha }}
|
||||
echo "sha=${SHA::7}" >> $GITHUB_OUTPUT
|
||||
echo "branch=${GITHUB_HEAD_REF//[^a-zA-Z0-9-]/-}" >> $GITHUB_OUTPUT
|
||||
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 }}
|
||||
id: snapshot
|
||||
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
|
||||
|
||||
- name: Publish to self-hosted npm repo
|
||||
run: pnpm --no-git-checks --registry https://npm.fluence.dev -r publish --tag e2e -filter '@fluencelabs/*'
|
||||
- run: pnpm -r build
|
||||
|
||||
- name: Print versions to check summary
|
||||
env:
|
||||
VERSION: ${{ steps.build.outputs.version }}
|
||||
- name: Publish to self-hosted npm repo
|
||||
run: |
|
||||
cat <<'SNAPSHOT' >> $GITHUB_STEP_SUMMARY
|
||||
## FluenceJS version is [${{ env.VERSION }}](https://npm.fluence.dev/-/web/detail/@fluencelabs/fluence/v/${{ env.VERSION }})
|
||||
To use it run:
|
||||
```shell
|
||||
npm i -E @fluencelabs/fluence@${{ env.VERSION }} --registry=https://npm.fluence.dev
|
||||
```
|
||||
SNAPSHOT
|
||||
# Publish to self-hosted npm repo
|
||||
pnpm --no-git-checks --registry https://npm.fluence.dev -r publish --tag snapshot -filter '@fluencelabs/*'
|
||||
|
||||
- name: Print info to check summary
|
||||
uses: fluencelabs/github-actions/npm-publish-snapshot@main
|
||||
with:
|
||||
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:
|
||||
- name: Import secrets
|
||||
uses: hashicorp/vault-action@v2.4.1
|
||||
uses: hashicorp/vault-action@v2.4.3
|
||||
with:
|
||||
url: https://vault.fluence.dev
|
||||
path: jwt/github
|
||||
@ -57,22 +57,17 @@ jobs:
|
||||
with:
|
||||
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
|
||||
run: docker pull $RUST_PEER_IMAGE
|
||||
|
||||
- name: Run rust-peer
|
||||
uses: isbang/compose-action@v1.1.0
|
||||
uses: isbang/compose-action@v1.4.1
|
||||
with:
|
||||
compose-file: ".github/e2e/docker-compose.yml"
|
||||
down-flags: "--volumes"
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2.2.2
|
||||
uses: pnpm/action-setup@v2.2.4
|
||||
with:
|
||||
version: 7
|
||||
|
||||
@ -85,10 +80,13 @@ jobs:
|
||||
|
||||
- run: pnpm i
|
||||
|
||||
- name: Set avm version from branch
|
||||
- name: Set avm version
|
||||
if: inputs.avm-version != ''
|
||||
working-directory: packages/fluence-js
|
||||
run: pnpm add --save -E @fluencelabs/avm@${{ inputs.avm-version }}
|
||||
uses: fluencelabs/github-actions/npm-set-dependency@main
|
||||
with:
|
||||
package: "@fluencelabs/avm"
|
||||
version: ${{ inputs.avm-version }}
|
||||
working-directory: packages/fluence-js
|
||||
|
||||
- run: pnpm -r build
|
||||
- run: pnpm -r test
|
||||
|
Loading…
x
Reference in New Issue
Block a user