ci: Prepare for E2E (#35)

This commit is contained in:
Anatolios Laskaris 2022-11-28 20:45:31 +02:00 committed by GitHub
parent 047b7db722
commit 83927b78cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 74 additions and 46 deletions

2
.cargo/config.toml Normal file
View File

@ -0,0 +1,2 @@
[registries]
fluence = { index = "git://crates.fluence.dev/index" }

19
.github/workflows/e2e.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: "e2e"
on:
pull_request:
paths-ignore:
- "**.md"
push:
branches:
- "master"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
marine-rs-sdk-test:
uses: ./.github/workflows/tests.yml
with:
ref: ${{ github.ref }}

View File

@ -1,45 +0,0 @@
name: "marine-rs-sdk-test"
on:
pull_request:
push:
branches:
- "master"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
env:
RUST_TEST_THREADS: 1
CARGO_HOME: "${{ github.workspace }}/cargo"
jobs:
marine-rs-sdk-test:
name: "Run tests"
runs-on: builder
steps:
- uses: actions/checkout@v3
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo build
run: cargo build
- name: Run cargo check
run: cargo check -v --all-features
- name: Run cargo test in marine-test-macro-impl
run: cargo test
working-directory: crates/marine-test-macro-impl
- name: Run cargo test
run: cargo test --release --all-features --no-fail-fast
- name: Run cargo clippy
run: cargo clippy -Z unstable-options --all

51
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,51 @@
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: "matster"
env:
RUST_TEST_THREADS: 1
jobs:
marine-rs-sdk-test:
name: "Run tests"
runs-on: builder
steps:
- name: Checkout to marine-rs-sdk-test
uses: actions/checkout@v3
with:
repository: "fluencelabs/marine-rs-sdk-test"
ref: ${{ inputs.ref }}
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Set dependencies
if: inputs.cargo-dependencies != ''
uses: fluencelabs/github-actions/cargo-set-dependency@main
with:
dependencies: ${{ inputs.cargo-dependencies }}
- name: Run cargo build
run: cargo build
- 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: Run rustfmt
uses: actions-rust-lang/rustfmt@v1

View File

@ -34,4 +34,4 @@ members = [
"crates/marine-test-macro",
"crates/marine-test-macro-impl",
"crates/marine-build-rs-generator",
]
]

View File

@ -1,3 +1,4 @@
[toolchain]
channel = "nightly-2022-08-30"
targets = [ "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "wasm32-wasi" ]
components = ["clippy", "rustfmt"]