Some checks failed
CI / Check (push) Failing after 2s
CI / Test (push) Failing after 2s
CI / Build (Linux x86_64) (push) Has been skipped
Security Audit / Vulnerability Scan (push) Failing after 2s
Security Audit / License & Security Policy (push) Failing after 2s
Security Audit / Static Analysis (Clippy) (push) Failing after 2s
Security Audit / Secret Detection (push) Failing after 2s
Security Audit / Check Outdated Dependencies (push) Failing after 2s
Security Audit / Unsafe Code Audit (push) Failing after 2s
Security Audit / Property-Based Testing (push) Failing after 2s
Security Audit / WASM Module Security (push) Failing after 2s
CI / Benchmarks (push) Has been skipped
CI / CI Success (push) Failing after 1s
- Move .github/workflows/ to .forgejo/workflows/ (identical YAML, runner labels changed to self-hosted) - Drop macOS/Windows CI matrix legs (no macOS/Windows runners on self-hosted act_runner) - Update Cargo.toml repository URL to git.misar.io/misaradmin/synor - Remove .github/dependabot.yml (not applicable on Forgejo)
216 lines
5.9 KiB
YAML
216 lines
5.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: -Dwarnings
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
check:
|
|
name: Check
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-registry-
|
|
|
|
- name: Cache cargo target
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-target-check-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-target-check-
|
|
|
|
- name: Check formatting
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Run clippy
|
|
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libclang-dev llvm-dev
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-registry-
|
|
|
|
- name: Cache cargo target
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-target-test-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-target-test-
|
|
|
|
- name: Run tests
|
|
run: cargo test --workspace --all-features
|
|
|
|
build:
|
|
name: Build (Linux x86_64)
|
|
runs-on: self-hosted
|
|
needs: [check, test]
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libclang-dev llvm-dev
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-registry-
|
|
|
|
- name: Cache cargo target
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-target-release-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-target-release-
|
|
|
|
- name: Build release binaries
|
|
run: cargo build --release --workspace
|
|
|
|
- name: Prepare artifacts
|
|
run: |
|
|
mkdir -p artifacts
|
|
cp target/release/synord artifacts/ 2>/dev/null || true
|
|
cp target/release/synor-cli artifacts/ 2>/dev/null || true
|
|
cp target/release/synor-faucet artifacts/ 2>/dev/null || true
|
|
cp target/release/synor-explorer artifacts/ 2>/dev/null || true
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: synor-linux-x86_64
|
|
path: artifacts/
|
|
retention-days: 7
|
|
if-no-files-found: warn
|
|
|
|
bench:
|
|
name: Benchmarks
|
|
runs-on: self-hosted
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
needs: [check, test]
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libclang-dev llvm-dev
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-registry-
|
|
|
|
- name: Cache cargo target
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-target-bench-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-target-bench-
|
|
|
|
- name: Run benchmarks
|
|
run: cargo bench --workspace
|
|
|
|
- name: Upload benchmark results
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: benchmark-results
|
|
path: target/criterion/
|
|
retention-days: 30
|
|
if-no-files-found: ignore
|
|
|
|
ci-success:
|
|
name: CI Success
|
|
runs-on: self-hosted
|
|
needs: [check, test, build]
|
|
if: always()
|
|
steps:
|
|
- name: Check all jobs passed
|
|
env:
|
|
CHECK_RESULT: ${{ needs.check.result }}
|
|
TEST_RESULT: ${{ needs.test.result }}
|
|
BUILD_RESULT: ${{ needs.build.result }}
|
|
run: |
|
|
if [[ "$CHECK_RESULT" != "success" ]] || \
|
|
[[ "$TEST_RESULT" != "success" ]] || \
|
|
[[ "$BUILD_RESULT" != "success" ]]; then
|
|
echo "One or more jobs failed"
|
|
exit 1
|
|
fi
|
|
echo "All CI jobs passed successfully"
|