Skip to content

Commit

Permalink
chore: update general-check.yaml to rust-check.yaml, and job names to…
Browse files Browse the repository at this point in the history
… lower case, and create bash script to ci job.
  • Loading branch information
devworlds committed Jan 6, 2025
1 parent e62691c commit 636ab78
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main

jobs:
MSRV:
msrv:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Build Projects
run: ./scripts/workflows/build.sh

SemVer:
semver:
runs-on: ubuntu-latest

steps:
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Run Semver Checks
run: ./scripts/workflows/semver.sh

Format:
fmt:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -75,7 +75,7 @@ jobs:
- name: Run fmt in different workspaces and crates
run: ./scripts/workflows/format.sh

Clippy:
clippy-check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -98,3 +98,27 @@ jobs:
components: clippy
- name: Run Clippy on different workspaces and crates
run: ./scripts/workflows/clippy.sh

ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-13
- ubuntu-latest
include:
- os: macos-13
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-musl

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set OS environment variable
run: echo "CI_OS=${{ matrix.os }}" >> $GITHUB_ENV

- name: Run CI script
run: ./scripts/workflows/test.sh
working-directory: .
46 changes: 46 additions & 0 deletions scripts/workflows/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Instala toolchain e componentes
cargo build --manifest-path=benches/Cargo.toml
cargo build --manifest-path=common/Cargo.toml
cargo build --manifest-path=protocols/Cargo.toml
cargo build --manifest-path=roles/Cargo.toml
cargo build --manifest-path=utils/Cargo.toml

# Testes de Integração de Roles
cargo test --manifest-path=roles/Cargo.toml --verbose --test '*' -- --nocapture

# Executa o exemplo de client_and_server
cargo run --manifest-path=examples/sv1-client-and-server/Cargo.toml --bin client_and_server -- 60

# Teste de Interop (somente no Ubuntu)
if [ "$CI_OS" == "ubuntu-latest" ]; then
./run.sh 30
else
echo "Skipping interop-test on $CI_OS - not supported"
fi
cd examples/interop-cpp/ || exit

# Teste de fuzz (somente no Ubuntu)
if [ "$CI_OS" == "ubuntu-latest" ]; then
./run.sh 30
else
echo "Skipping fuzz test on $CI_OS - not supported"
fi
cd utils/buffer/fuzz || exit

# Testes gerais
cargo test --manifest-path=benches/Cargo.toml
cargo test --manifest-path=common/Cargo.toml
cargo test --manifest-path=protocols/Cargo.toml
cargo test --manifest-path=roles/Cargo.toml
cargo test --manifest-path=utils/Cargo.toml

# Testes baseados em propriedades
cargo test --manifest-path=protocols/Cargo.toml --features prop_test

# Executa o exemplo de ping-pong-with-noise
cargo run --manifest-path=examples/ping-pong-with-noise/Cargo.toml --bin ping_pong_with_noise -- 10

# Executa o exemplo de ping-pong-without-noise
cargo run --manifest-path=examples/ping-pong-without-noise/Cargo.toml --bin ping_pong_without_noise -- 10

0 comments on commit 636ab78

Please sign in to comment.