mirror of
https://github.com/fluencelabs/marine.git
synced 2025-03-15 22:10:49 +00:00
Make tests workflow callable
This commit is contained in:
parent
9ac2856acf
commit
c42e057429
126
.github/workflows/run-tests.yml
vendored
126
.github/workflows/run-tests.yml
vendored
@ -6,130 +6,14 @@ on:
|
||||
- "**.md"
|
||||
- ".github/**"
|
||||
- "!.github/workflows/run-tests.yml"
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- ".github/**"
|
||||
- "!.github/workflows/tests.yml"
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "marine / cargo and marine-js"
|
||||
runs-on: builder
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: dsherret/rust-toolchain-file@v1
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-directories: ~/.cache/sccache
|
||||
shared-key: marine
|
||||
# github allows only 10GB of cache
|
||||
# so save cache only on merge to master
|
||||
# to use less space and speed up CI
|
||||
save-if: ${{ github.event_name == 'push' }}
|
||||
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.3
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install wasm-pack
|
||||
uses: jetli/wasm-pack-action@v0.4.0
|
||||
|
||||
- name: Install marine cli
|
||||
run: cargo install --path tools/cli
|
||||
|
||||
- name: Build marine-js wasm
|
||||
run: ./build.sh
|
||||
working-directory: marine-js
|
||||
|
||||
- name: Install marine-js npm dependencies
|
||||
uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
working-directory: marine-js/npm-package
|
||||
|
||||
- name: Build marine-js npm package
|
||||
run: npm run build
|
||||
working-directory: marine-js/npm-package
|
||||
|
||||
- name: Build examples
|
||||
run: ./build.sh
|
||||
working-directory: examples
|
||||
|
||||
- name: Build marine-runtime wasm-tests
|
||||
run: ./build.sh
|
||||
working-directory: marine/tests/wasm_tests
|
||||
|
||||
- name: Build marine-core wasm-tests
|
||||
run: ./build.sh
|
||||
working-directory: core/tests/wasm_tests
|
||||
|
||||
- name: Run cargo check
|
||||
run: |
|
||||
cargo check -v --all-features \
|
||||
-p marine-core \
|
||||
-p marine \
|
||||
-p fluence-app-service \
|
||||
-p marine \
|
||||
-p mrepl
|
||||
|
||||
- uses: taiki-e/install-action@cargo-llvm-cov
|
||||
- uses: taiki-e/install-action@nextest
|
||||
|
||||
- name: Run cargo nextest
|
||||
run: cargo llvm-cov nextest --release -v --all-features --profile ci --lcov --output-path lcov.info \
|
||||
-p marine-core \
|
||||
-p marine \
|
||||
-p fluence-app-service \
|
||||
-p marine \
|
||||
-p mrepl \
|
||||
|
||||
- name: Coveralls upload
|
||||
uses: coverallsapp/github-action@v2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: lcov.info
|
||||
|
||||
- name: Archive code coverage results
|
||||
if: github.event.pull_request.head.repo.fork != true
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: code-coverage-report.zip
|
||||
path: lcov.info
|
||||
|
||||
- name: Upload test report
|
||||
uses: dorny/test-reporter@v1
|
||||
if: (success() || failure()) && !github.event.pull_request.head.repo.fork
|
||||
with:
|
||||
name: marine report
|
||||
path: target/nextest/ci/junit.xml
|
||||
reporter: java-junit
|
||||
|
||||
- name: Run cargo clippy
|
||||
run: cargo clippy -v
|
||||
|
||||
- name: Run marine-js smoke tests
|
||||
run: npm run test
|
||||
working-directory: marine-js/npm-package
|
||||
|
||||
- name: Run cargo fmt
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
marine:
|
||||
uses: ./.github/workflows/tests.yml
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
139
.github/workflows/tests.yml
vendored
Normal file
139
.github/workflows/tests.yml
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
name: "Run tests with workflow_call"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ref:
|
||||
description: "git ref to checkout to"
|
||||
type: string
|
||||
default: "master"
|
||||
cargo-dependencies:
|
||||
description: "Cargo dependencies map"
|
||||
type: string
|
||||
default: "null"
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "marine / cargo and marine-js"
|
||||
runs-on: builder
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.ref }}
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: dsherret/rust-toolchain-file@v1
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-directories: ~/.cache/sccache
|
||||
shared-key: marine
|
||||
# github allows only 10GB of cache
|
||||
# so save cache only on merge to master
|
||||
# to use less space and speed up CI
|
||||
save-if: ${{ github.event_name == 'push' }}
|
||||
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.3
|
||||
|
||||
- name: Set dependencies
|
||||
if: inputs.cargo-dependencies != 'null'
|
||||
uses: fluencelabs/github-actions/cargo-set-dependency@main
|
||||
with:
|
||||
dependencies: ${{ inputs.cargo-dependencies }}
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install wasm-pack
|
||||
uses: jetli/wasm-pack-action@v0.4.0
|
||||
|
||||
- name: Install marine cli
|
||||
run: cargo install --path tools/cli
|
||||
|
||||
- name: Build marine-js wasm
|
||||
run: ./build.sh
|
||||
working-directory: marine-js
|
||||
|
||||
- name: Install marine-js npm dependencies
|
||||
uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
working-directory: marine-js/npm-package
|
||||
|
||||
- name: Build marine-js npm package
|
||||
run: npm run build
|
||||
working-directory: marine-js/npm-package
|
||||
|
||||
- name: Build examples
|
||||
run: ./build.sh
|
||||
working-directory: examples
|
||||
|
||||
- name: Build marine-runtime wasm-tests
|
||||
run: ./build.sh
|
||||
working-directory: marine/tests/wasm_tests
|
||||
|
||||
- name: Build marine-core wasm-tests
|
||||
run: ./build.sh
|
||||
working-directory: core/tests/wasm_tests
|
||||
|
||||
- name: Run cargo check
|
||||
run: |
|
||||
cargo check -v --all-features \
|
||||
-p marine-core \
|
||||
-p marine \
|
||||
-p fluence-app-service \
|
||||
-p marine \
|
||||
-p mrepl
|
||||
|
||||
- uses: taiki-e/install-action@cargo-llvm-cov
|
||||
- uses: taiki-e/install-action@nextest
|
||||
|
||||
- name: Run cargo nextest
|
||||
run: cargo llvm-cov nextest --release -v --all-features --profile ci --lcov --output-path lcov.info \
|
||||
-p marine-core \
|
||||
-p marine \
|
||||
-p fluence-app-service \
|
||||
-p marine \
|
||||
-p mrepl \
|
||||
|
||||
- name: Coveralls upload
|
||||
if: inputs.cargo-dependencies == 'null'
|
||||
uses: coverallsapp/github-action@v2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: lcov.info
|
||||
|
||||
- name: Archive code coverage results
|
||||
if: github.event.pull_request.head.repo.fork != true
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: code-coverage-report.zip
|
||||
path: lcov.info
|
||||
|
||||
- name: Upload test report
|
||||
uses: dorny/test-reporter@v1
|
||||
if: (success() || failure()) && !github.event.pull_request.head.repo.fork
|
||||
with:
|
||||
name: marine report
|
||||
path: target/nextest/ci/junit.xml
|
||||
reporter: java-junit
|
||||
|
||||
- name: Run cargo clippy
|
||||
run: cargo clippy -v
|
||||
|
||||
- name: Run marine-js smoke tests
|
||||
run: npm run test
|
||||
working-directory: marine-js/npm-package
|
||||
|
||||
- name: Run cargo fmt
|
||||
run: cargo fmt --all -- --check
|
Loading…
x
Reference in New Issue
Block a user