-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update E2E [fixes FLU-297 and FLU-252 and FLU-298 and FLU-267] (…
…#1538) * Update * Fix * Cleanup * Fix lint * Naming * Naming 2 * Cleanup
- Loading branch information
Showing
5 changed files
with
155 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: "Build rust-peer binary" | ||
|
||
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" | ||
outputs: | ||
rust-peer-sha: | ||
description: "rust-peer sha256 hash" | ||
value: ${{ jobs.build.outputs.sha256 }} | ||
|
||
jobs: | ||
build: | ||
name: "Build rust-peer" | ||
runs-on: builder | ||
timeout-minutes: 60 | ||
|
||
env: | ||
RUSTFLAGS: "-D warnings --cfg tokio_unstable" | ||
|
||
outputs: | ||
sha256: "${{ steps.sha.outputs.sha256 }}" | ||
|
||
steps: | ||
- name: Checkout rust-peer | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: fluencelabs/rust-peer | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Setup Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- name: Get PR labels | ||
id: labels | ||
uses: joerick/[email protected] | ||
|
||
- name: Set profile | ||
id: profile | ||
run: | | ||
if [[ -n "$GITHUB_PR_LABEL_PROFILING" ]]; then | ||
echo "profile=profiling" >> $GITHUB_OUTPUT | ||
echo "flags=--profile=profiling --features particle-node/dhat-heap" >> $GITHUB_OUTPUT | ||
else | ||
echo "profile=release" >> $GITHUB_OUTPUT | ||
echo "flags=--profile=release" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Set dependencies | ||
if: inputs.cargo-dependencies != 'null' | ||
uses: fluencelabs/github-actions/cargo-set-dependency@main | ||
with: | ||
dependencies: ${{ inputs.cargo-dependencies }} | ||
|
||
- name: Generate snapshot version | ||
id: version | ||
uses: fluencelabs/github-actions/generate-snapshot-id@main | ||
|
||
- name: Set version | ||
id: snapshot | ||
uses: fluencelabs/github-actions/cargo-publish-snapshot@main | ||
with: | ||
id: ${{ steps.version.outputs.id }} | ||
publish: false | ||
|
||
- name: Run cargo build | ||
run: cargo build ${{ steps.profile.outputs.flags }} -p particle-node | ||
|
||
- name: Calculate SHA256 | ||
id: sha | ||
working-directory: ./target/${{ steps.profile.outputs.profile }} | ||
run: | | ||
# Calculate sha256 | ||
du -hs particle-node | ||
sha256sum particle-node | ||
sha=($(sha256sum particle-node)) | ||
echo "sha256=${sha}" >> $GITHUB_OUTPUT | ||
- name: Upload rust-peer binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rust-peer | ||
path: target/${{ steps.profile.outputs.profile }}/particle-node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Run tests | ||
name: "test" | ||
|
||
on: | ||
pull_request: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
name: Publish snapshot | ||
# Compatibility workflow | ||
name: "Publish snapshot" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: "GitHub ref to checkout to" | ||
description: "git ref to checkout to" | ||
type: string | ||
default: "master" | ||
image-name: | ||
|
@@ -14,6 +15,7 @@ on: | |
cargo-dependencies: | ||
description: "Cargo dependencies map" | ||
type: string | ||
default: "null" | ||
outputs: | ||
rust-peer-image: | ||
description: "rust-peer snapshot image" | ||
|
@@ -24,76 +26,11 @@ on: | |
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
ref: ${{ inputs.ref }} | ||
name: "Build" | ||
runs-on: builder | ||
timeout-minutes: 60 | ||
|
||
outputs: | ||
sha256: "${{ steps.sha.outputs.sha256 }}" | ||
|
||
steps: | ||
- name: Checkout rust-peer | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: fluencelabs/rust-peer | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Get PR labels | ||
id: labels | ||
uses: joerick/[email protected] | ||
|
||
- name: Setup Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- name: Set profile | ||
id: profile | ||
run: | | ||
if [[ -n "$GITHUB_PR_LABEL_PROFILING" ]]; then | ||
echo "profile=profiling" >> $GITHUB_OUTPUT | ||
echo "flags=--profile=profiling --features particle-node/dhat-heap" >> $GITHUB_OUTPUT | ||
else | ||
echo "profile=release" >> $GITHUB_OUTPUT | ||
echo "flags=--profile=release" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Set dependencies | ||
if: inputs.cargo-dependencies != '' | ||
uses: fluencelabs/github-actions/cargo-set-dependency@main | ||
with: | ||
dependencies: ${{ inputs.cargo-dependencies }} | ||
|
||
- name: Generate snapshot version | ||
id: version | ||
uses: fluencelabs/github-actions/generate-snapshot-id@main | ||
|
||
- name: Set version | ||
id: snapshot | ||
uses: fluencelabs/github-actions/cargo-publish-snapshot@main | ||
with: | ||
id: ${{ steps.version.outputs.id }} | ||
publish: false | ||
|
||
- name: Run cargo build | ||
env: | ||
RUSTFLAGS: "--cfg tokio_unstable" | ||
run: cargo build ${{ steps.profile.outputs.flags }} -p particle-node | ||
|
||
- name: Calculate SHA256 | ||
id: sha | ||
working-directory: ./target/${{ steps.profile.outputs.profile }} | ||
run: | | ||
# Calculate sha256 | ||
du -hs particle-node | ||
sha256sum particle-node | ||
sha=($(sha256sum particle-node)) | ||
echo "sha256=${sha}" >> $GITHUB_OUTPUT | ||
- name: Upload rust-peer binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rust-peer | ||
path: target/${{ steps.profile.outputs.profile }}/particle-node | ||
|
||
|
||
container: | ||
needs: build | ||
uses: ./.github/workflows/container.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,23 @@ | ||
name: Run tests | ||
name: "Run tests with workflow_call" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: "GitHub ref to checkout to" | ||
description: "git ref to checkout to" | ||
type: string | ||
default: "master" | ||
cargo-dependencies: | ||
description: "Cargo dependencies map" | ||
type: string | ||
default: "null" | ||
|
||
jobs: | ||
lint: | ||
name: cargo lints | ||
runs-on: builder | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: fluencelabs/rust-peer | ||
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 fmt | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Run cargo clippy | ||
env: | ||
RUSTFLAGS: "--cfg tokio_unstable" | ||
run: cargo clippy -Z unstable-options --all | ||
env: | ||
RUSTFLAGS: "-D warnings --cfg tokio_unstable" | ||
|
||
jobs: | ||
tests: | ||
name: cargo nextest | ||
name: "cargo nextest" | ||
runs-on: builder | ||
timeout-minutes: 60 | ||
|
||
|
@@ -55,20 +32,14 @@ jobs: | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- name: Set dependencies | ||
if: inputs.cargo-dependencies != '' | ||
if: inputs.cargo-dependencies != 'null' | ||
uses: fluencelabs/github-actions/cargo-set-dependency@main | ||
with: | ||
dependencies: ${{ inputs.cargo-dependencies }} | ||
|
||
- name: Install cargo-nextest | ||
uses: baptiste0928/[email protected] | ||
with: | ||
crate: cargo-nextest | ||
version: 0.9.22 | ||
- uses: taiki-e/install-action@nextest | ||
|
||
- name: Run cargo nextest | ||
env: | ||
RUSTFLAGS: "--cfg tokio_unstable" | ||
run: cargo nextest run --release --all-features --profile ci | ||
|
||
- name: Upload test report | ||
|
@@ -78,3 +49,9 @@ jobs: | |
name: cargo nextest report | ||
path: target/nextest/ci/junit.xml | ||
reporter: java-junit | ||
|
||
- name: Run cargo fmt | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Run cargo clippy | ||
run: cargo clippy -Z unstable-options --all |