2022-09-06 14:51:43 +00:00
|
|
|
name: Run tests with worflow_call
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
rust-peer-image:
|
|
|
|
description: "rust-peer image tag"
|
|
|
|
type: string
|
|
|
|
default: "fluencelabs/fluence:minimal"
|
2022-09-13 16:24:20 +00:00
|
|
|
avm-version:
|
|
|
|
description: "@fluencelabs/avm version"
|
2022-09-06 14:51:43 +00:00
|
|
|
type: string
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_PEER_IMAGE: "${{ inputs.rust-peer-image }}"
|
|
|
|
FORCE_COLOR: true
|
|
|
|
CI: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
fluence-js:
|
|
|
|
name: "Run tests"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version:
|
|
|
|
- 16.x
|
|
|
|
- 17.x
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Import secrets
|
|
|
|
uses: hashicorp/vault-action@v2.4.1
|
|
|
|
with:
|
|
|
|
url: https://vault.fluence.dev
|
|
|
|
path: jwt/github
|
|
|
|
role: ci
|
|
|
|
method: jwt
|
|
|
|
jwtGithubAudience: "https://github.com/fluencelabs"
|
|
|
|
jwtTtl: 300
|
|
|
|
secrets: |
|
|
|
|
kv/docker-registry/basicauth/ci username | DOCKER_USERNAME ;
|
|
|
|
kv/docker-registry/basicauth/ci password | DOCKER_PASSWORD
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: docker.fluence.dev
|
|
|
|
username: ${{ env.DOCKER_USERNAME }}
|
|
|
|
password: ${{ env.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
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
|
|
|
|
with:
|
|
|
|
compose-file: ".github/e2e/docker-compose.yml"
|
|
|
|
down-flags: "--volumes"
|
|
|
|
|
|
|
|
- name: Setup pnpm
|
|
|
|
uses: pnpm/action-setup@v2.2.2
|
|
|
|
with:
|
|
|
|
version: 7
|
|
|
|
|
2022-09-13 16:24:20 +00:00
|
|
|
- name: Setup node ${{ matrix.node-version }} with self-hosted registry
|
|
|
|
uses: actions/setup-node@v3
|
2022-09-06 14:51:43 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2022-09-13 16:24:20 +00:00
|
|
|
registry-url: "https://npm.fluence.dev"
|
|
|
|
cache: "pnpm"
|
|
|
|
|
2022-10-10 16:09:16 +00:00
|
|
|
- run: pnpm i
|
|
|
|
|
2022-09-13 16:24:20 +00:00
|
|
|
- name: Set avm version from branch
|
|
|
|
if: inputs.avm-version != ''
|
|
|
|
working-directory: packages/fluence-js
|
2022-10-10 16:09:16 +00:00
|
|
|
run: pnpm add --save @fluencelabs/avm@${{ inputs.avm-version }}
|
2022-09-06 14:51:43 +00:00
|
|
|
|
|
|
|
- run: pnpm -r build
|
|
|
|
- run: pnpm -r test
|