aqua/.github/workflows/tests.yml
renovate[bot] 9fdf4e1005
chore(deps): update hashicorp/vault-action action to v2.7.0 (#762)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-28 14:46:38 +03:00

126 lines
3.4 KiB
YAML

name: Run tests with workflow_call
on:
workflow_call:
inputs:
ref:
description: "git ref to checkout to"
type: string
default: "main"
fluence-env:
description: "Fluence enviroment to run tests agains"
type: string
default: "local"
rust-peer-image:
description: "rust-peer image tag"
type: string
default: "fluencelabs/rust-peer:minimal"
js-client-snapshots:
description: "js-client snapshots"
type: string
default: "null"
env:
FORCE_COLOR: true
RUST_PEER_IMAGE: "${{ inputs.rust-peer-image }}"
FLUENCE_ENV: "${{ inputs.fluence-env }}"
jobs:
aqua:
name: "Run tests"
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
id-token: write
steps:
- name: Import secrets
uses: hashicorp/vault-action@v2.7.0
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 ;
kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN;
kv/slack/node-alerts webhook | INCOMING_WEBHOOK_URL
- 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/aqua
ref: ${{ inputs.ref }}
- name: Pull rust-peer image
run: docker pull $RUST_PEER_IMAGE
- name: Run rust-peer
uses: isbang/compose-action@v1.4.1
with:
compose-file: ".github/e2e/docker-compose.yml"
down-flags: "--volumes"
- name: Cache Scala
uses: coursier/cache-action@v6
- name: Setup Scala
uses: coursier/setup-action@v1
with:
apps: sbt
- name: cli-js build
run: sbt "cliJS/fastOptJS"
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 8
- name: Setup node with self-hosted registry
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://npm.fluence.dev"
cache: "pnpm"
- run: pnpm install
working-directory: integration-tests
- name: Override dependencies
if: inputs.js-client-snapshots != 'null'
uses: fluencelabs/github-actions/pnpm-set-dependency@main
with:
dependencies: |
{
"@fluencelabs/js-client.node": "${{ fromJson(inputs.js-client-snapshots)['js-client.node'] }}",
"@fluencelabs/js-client.api": "${{ fromJson(inputs.js-client-snapshots)['js-client.api'] }}"
}
- name: Build cli
run: pnpm run build
working-directory: cli/cli-npm
- name: Compule aqua
run: pnpm run compile-aqua
working-directory: integration-tests
- run: pnpm run test
working-directory: integration-tests
- name: Dump rust-peer logs
if: always()
uses: jwalton/gh-docker-logs@v2