mirror of
https://github.com/fluencelabs/registry.git
synced 2025-04-24 17:52:14 +00:00
* Get rid of buildin package * Add snapshot workflow * Cleanup * Change name * Typo * Fix * Fix * Setup node * Disable rust cache * Build nox snapshot * Fix * Fix
189 lines
5.1 KiB
YAML
189 lines
5.1 KiB
YAML
name: Run tests with workflow_call
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
fluence-env:
|
|
description: "Fluence enviroment to run tests agains"
|
|
type: string
|
|
default: "local"
|
|
nox-image:
|
|
description: "nox image tag"
|
|
type: string
|
|
default: "fluencelabs/nox:unstable_minimal"
|
|
flox-version:
|
|
description: "@fluencelabs/flox version"
|
|
type: string
|
|
default: "null"
|
|
cargo-dependencies:
|
|
description: "Cargo dependencies map"
|
|
type: string
|
|
ref:
|
|
description: "git ref to checkout to"
|
|
type: string
|
|
default: "main"
|
|
|
|
env:
|
|
CI: true
|
|
FORCE_COLOR: true
|
|
NOX_IMAGE: "${{ inputs.nox-image }}"
|
|
FLUENCE_ENV: "${{ inputs.fluence-env }}"
|
|
|
|
jobs:
|
|
aqua:
|
|
name: "Run aqua tests"
|
|
runs-on: builder
|
|
timeout-minutes: 60
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Import secrets
|
|
uses: hashicorp/vault-action@v2.5.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;
|
|
|
|
- name: Checkout registry
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: fluencelabs/registry
|
|
ref: ${{ inputs.ref }}
|
|
|
|
- name: Setup node with self-hosted registry
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "18"
|
|
registry-url: "https://npm.fluence.dev"
|
|
cache: "npm"
|
|
cache-dependency-path: "**/package-lock.json"
|
|
|
|
- name: Run npm install in aqua
|
|
run: npm install
|
|
working-directory: aqua
|
|
|
|
- name: Run npm install in aqua-tests
|
|
run: npm install
|
|
working-directory: aqua-tests
|
|
|
|
- name: Set flox version
|
|
if: inputs.flox-version != 'null'
|
|
uses: fluencelabs/github-actions/npm-set-dependency@main
|
|
with:
|
|
package: "@fluencelabs/cli"
|
|
version: ${{ inputs.flox-version }}
|
|
working-directory: aqua-tests
|
|
flags: "--save-dev"
|
|
|
|
- name: Setup Rust toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
cache: false
|
|
|
|
- name: Download marine artifact
|
|
id: marine
|
|
uses: actions/download-artifact@v3
|
|
continue-on-error: true
|
|
with:
|
|
name: marine
|
|
path: ~/.local/bin
|
|
|
|
- name: Make marine executable
|
|
if: steps.marine.outcome == 'success'
|
|
run: chmod +x ~/.local/bin/marine
|
|
|
|
- name: Setup marine
|
|
if: steps.marine.outcome == 'failure'
|
|
uses: fluencelabs/setup-marine@v1
|
|
|
|
- name: Set dependencies
|
|
if: inputs.cargo-dependencies != ''
|
|
uses: fluencelabs/github-actions/cargo-set-dependency@main
|
|
with:
|
|
dependencies: ${{ inputs.cargo-dependencies }}
|
|
path: service/
|
|
|
|
- name: Build service
|
|
run: ./build.sh
|
|
working-directory: service
|
|
|
|
- name: Build distro
|
|
run: ./build.sh
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: docker.fluence.dev
|
|
username: ${{ env.DOCKER_USERNAME }}
|
|
password: ${{ env.DOCKER_PASSWORD }}
|
|
|
|
- name: Pull nox image
|
|
run: docker pull $NOX_IMAGE
|
|
|
|
- name: Run nox network
|
|
uses: isbang/compose-action@v1.4.1
|
|
with:
|
|
compose-file: ".github/e2e/docker-compose.yml"
|
|
down-flags: "--volumes"
|
|
|
|
- name: Setup python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.9"
|
|
cache: "pip"
|
|
cache-dependency-path: aqua-tests/requirements.txt
|
|
|
|
- name: Install python requirements
|
|
run: pip install -r requirements.txt
|
|
working-directory: aqua-tests
|
|
|
|
- name: Install flox dependencies
|
|
env:
|
|
FLUENCE_USER_DIR: "${{ github.workspace }}/tmp/.fluence"
|
|
run: npx fluence dep i --no-input
|
|
working-directory: aqua-tests
|
|
|
|
- name: Print flox version
|
|
run: pytest -s test_fluence_cli_version.py
|
|
working-directory: aqua-tests
|
|
|
|
- name: Run aqua tests
|
|
env:
|
|
FLUENCE_USER_DIR: "${{ github.workspace }}/tmp/.fluence"
|
|
NPM_CONFIG_REGISTRY: "https://npm.fluence.dev"
|
|
run: pytest test_aqua.py
|
|
working-directory: aqua-tests
|
|
|
|
- name: Print versions to check summary
|
|
if: always()
|
|
working-directory: aqua-tests
|
|
run: |
|
|
cat <<SNAPSHOT >> $GITHUB_STEP_SUMMARY
|
|
## Used versions
|
|
\`\`\`
|
|
$(npx fluence dep v)
|
|
\`\`\`
|
|
SNAPSHOT
|
|
|
|
- name: Dump rust-peer logs on failure
|
|
if: always()
|
|
uses: jwalton/gh-docker-logs@v2
|
|
|
|
- name: Remove registry directory
|
|
if: always()
|
|
run: sudo rm -rf registry
|
|
|
|
- name: Remove tmp directory
|
|
if: always()
|
|
run: sudo rm -rf tmp
|