aqua/.github/workflows/tests.yml
Anatolios Laskaris aa10706506
chore: Refactor CI after moving tests from aqua-playground [fixes FLU-352] (#763)
* move integration tests to repo

* Move aqua-playground CI

* Fix

* Use local aqua cli

* Move aqua tests to e2e

* Test new build.sbt

* Fix?

* Test

* Test

* Test

* Test

* Update

* Fix

* Fix

* Fix

* fix

* Fix

* Rename aqua-api to api directory for consistency

* Migrate to pnpm

* Add bump version script

* Test snapshot workflow

* fix

* Fix

* Fix

* Setup pnpm

* Update pnpm version

* Fix

* Do not publish tests

* Update

* Fix

* Fix?

* delete import

* Fix

* Fix

* Fix?

* Fix

* Fix

* Use main branch

* Fix quotes

* Fix

* Fix release

* Cleanup

* Remove compiled examples

* Cleanup

---------

Co-authored-by: DieMyst <dmitry.shakhtarin@fluence.ai>
2023-06-22 14:59:56 +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: "master"
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.6.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