2023-04-05 12:28:51 +00:00
|
|
|
name: Run tests with workflow_call
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
ref:
|
|
|
|
description: "git ref to checkout to"
|
|
|
|
type: string
|
2023-06-22 12:13:24 +00:00
|
|
|
default: "main"
|
2023-06-22 11:59:56 +00:00
|
|
|
fluence-env:
|
|
|
|
description: "Fluence enviroment to run tests agains"
|
|
|
|
type: string
|
|
|
|
default: "local"
|
2023-07-10 06:40:58 +00:00
|
|
|
nox-image:
|
|
|
|
description: "nox image tag"
|
2023-06-22 11:59:56 +00:00
|
|
|
type: string
|
2024-01-29 15:30:50 +00:00
|
|
|
default: "fluencelabs/nox:unstable"
|
2023-06-22 11:59:56 +00:00
|
|
|
js-client-snapshots:
|
|
|
|
description: "js-client snapshots"
|
|
|
|
type: string
|
|
|
|
default: "null"
|
|
|
|
|
|
|
|
env:
|
|
|
|
FORCE_COLOR: true
|
2023-07-10 06:40:58 +00:00
|
|
|
NOX_IMAGE: "${{ inputs.nox-image }}"
|
2023-06-22 11:59:56 +00:00
|
|
|
FLUENCE_ENV: "${{ inputs.fluence-env }}"
|
2023-04-05 12:28:51 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-06-22 11:59:56 +00:00
|
|
|
aqua:
|
|
|
|
name: "Run tests"
|
2023-04-05 12:28:51 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-06-22 11:59:56 +00:00
|
|
|
timeout-minutes: 60
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
id-token: write
|
2023-04-05 12:28:51 +00:00
|
|
|
|
|
|
|
steps:
|
2023-06-22 11:59:56 +00:00
|
|
|
- name: Import secrets
|
2024-05-20 06:54:49 +00:00
|
|
|
uses: hashicorp/vault-action@v3.0.0
|
2023-06-22 11:59:56 +00:00
|
|
|
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
|
2023-12-13 09:46:28 +00:00
|
|
|
uses: docker/login-action@v3
|
2023-06-22 11:59:56 +00:00
|
|
|
with:
|
|
|
|
registry: docker.fluence.dev
|
|
|
|
username: ${{ env.DOCKER_USERNAME }}
|
|
|
|
password: ${{ env.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Checkout
|
2023-09-11 12:42:20 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-04-05 12:28:51 +00:00
|
|
|
with:
|
|
|
|
repository: fluencelabs/aqua
|
|
|
|
ref: ${{ inputs.ref }}
|
|
|
|
|
2023-07-10 06:40:58 +00:00
|
|
|
- name: Pull nox image
|
|
|
|
run: docker pull $NOX_IMAGE
|
2023-06-22 11:59:56 +00:00
|
|
|
|
2023-07-10 06:40:58 +00:00
|
|
|
- name: Run nox
|
2024-05-20 06:54:49 +00:00
|
|
|
uses: isbang/compose-action@v2.0.0
|
2023-06-22 11:59:56 +00:00
|
|
|
with:
|
|
|
|
compose-file: ".github/e2e/docker-compose.yml"
|
|
|
|
down-flags: "--volumes"
|
|
|
|
|
2023-04-05 12:28:51 +00:00
|
|
|
- name: Cache Scala
|
|
|
|
uses: coursier/cache-action@v6
|
|
|
|
|
|
|
|
- name: Setup Scala
|
|
|
|
uses: coursier/setup-action@v1
|
|
|
|
with:
|
|
|
|
apps: sbt
|
|
|
|
|
2023-09-12 10:11:50 +00:00
|
|
|
- name: aqua-api build
|
2023-09-18 07:53:25 +00:00
|
|
|
run: sbt "aqua-apiJS/fastBundleJS"
|
2023-06-22 11:59:56 +00:00
|
|
|
|
|
|
|
- name: Setup pnpm
|
2024-05-20 06:54:49 +00:00
|
|
|
uses: pnpm/action-setup@v4.0.0
|
2023-06-22 11:59:56 +00:00
|
|
|
with:
|
|
|
|
version: 8
|
|
|
|
|
|
|
|
- name: Setup node with self-hosted registry
|
2023-12-13 09:46:28 +00:00
|
|
|
uses: actions/setup-node@v4
|
2023-06-22 11:59:56 +00:00
|
|
|
with:
|
2023-08-24 10:20:34 +00:00
|
|
|
node-version: "18"
|
2023-06-22 11:59:56 +00:00
|
|
|
registry-url: "https://npm.fluence.dev"
|
|
|
|
cache: "pnpm"
|
|
|
|
|
|
|
|
- name: Override dependencies
|
|
|
|
if: inputs.js-client-snapshots != 'null'
|
|
|
|
uses: fluencelabs/github-actions/pnpm-set-dependency@main
|
|
|
|
with:
|
|
|
|
dependencies: |
|
|
|
|
{
|
2023-08-25 08:39:10 +00:00
|
|
|
"@fluencelabs/js-client": "${{ fromJson(inputs.js-client-snapshots)['js-client'] }}"
|
2023-06-22 11:59:56 +00:00
|
|
|
}
|
|
|
|
|
2023-08-03 12:12:46 +00:00
|
|
|
- run: pnpm install --no-frozen-lockfile
|
2023-08-03 11:04:08 +00:00
|
|
|
working-directory: integration-tests
|
|
|
|
|
2023-06-29 10:12:59 +00:00
|
|
|
- name: Compile aqua
|
2023-06-22 11:59:56 +00:00
|
|
|
run: pnpm run compile-aqua
|
|
|
|
working-directory: integration-tests
|
|
|
|
|
|
|
|
- run: pnpm run test
|
|
|
|
working-directory: integration-tests
|
|
|
|
|
2023-07-10 06:40:58 +00:00
|
|
|
- name: Dump nox logs
|
2023-06-22 11:59:56 +00:00
|
|
|
if: always()
|
|
|
|
uses: jwalton/gh-docker-logs@v2
|