marine-rs-sdk-test/.github/workflows/tests.yml
Valery Antopol 0e164f32d2
chore(examples, ci): fix examples build (#101)
* update fluence-app-service to 0.29.0

* Try fix the CI examples build

* fix example build
2023-12-14 17:09:44 +03:00

104 lines
2.7 KiB
YAML

name: Run tests with workflow_call
on:
workflow_call:
inputs:
cargo-dependencies:
description: "Cargo dependencies map"
type: string
ref:
description: "git ref to checkout to"
type: string
default: "master"
outputs:
cargo-version:
description: "Cargo snapshot version"
value: ${{ jobs.tests.outputs.version }}
jobs:
tests:
name: "Run tests"
runs-on: builder
outputs:
version: "${{ steps.snapshot.outputs.version }}"
permissions:
contents: read
id-token: write
steps:
- name: Checkout to repository
uses: actions/checkout@v3
with:
repository: fluencelabs/marine-rs-sdk-test
ref: ${{ inputs.ref }}
- 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
exportToken: false
secrets: |
kv/cargo-registry/users/ci token | CARGO_REGISTRIES_FLUENCE_TOKEN
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- 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 }}
- name: Build examples
working-directory: examples
run: ./build.sh
- name: Run cargo check
run: cargo check -v --all-features
- name: Run cargo test
run: cargo test --release --all-features --no-fail-fast
- name: Run cargo clippy
run: cargo clippy -Z unstable-options --all
- name: Test examples
run: cargo test -p single-service-example -p multi-service-example -p build-rs-example
- name: Run rustfmt
uses: actions-rust-lang/rustfmt@v1
- name: Generate snapshot version
id: version
uses: fluencelabs/github-actions/generate-snapshot-id@main
- name: Publish crate snapshots
id: snapshot
uses: fluencelabs/github-actions/cargo-publish-snapshot@main
with:
id: ${{ steps.version.outputs.id }}