deps(deps): update sha2 requirement from 0.10 to 0.11 in /relayer #88
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| PYTHON_VERSION: '3.11' | |
| NODE_VERSION: '18' | |
| jobs: | |
| smart-contracts: | |
| name: Smart Contracts (Rust/Soroban) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| components: clippy, rustfmt | |
| - name: Cache cargo registry | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| smartcontract/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Install wasm32 target | |
| run: rustup target add wasm32-unknown-unknown | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| working-directory: smartcontract | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| working-directory: smartcontract | |
| - name: Build smart contract | |
| run: cargo build --target wasm32-unknown-unknown --release | |
| working-directory: smartcontract | |
| - name: Run tests | |
| run: cargo test --all-features | |
| working-directory: smartcontract | |
| - name: Upload WASM artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: chainbridge-wasm | |
| path: smartcontract/target/wasm32-unknown-unknown/release/*.wasm | |
| retention-days: 7 | |
| backend: | |
| name: Backend (Python/FastAPI) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8 black mypy pytest pytest-cov | |
| if [ -f backend/requirements.txt ]; then pip install -r backend/requirements.txt; fi | |
| - name: Check formatting with Black | |
| run: black --check backend/ | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 backend/ --count --select=E9,F63,F7,F82 --show-source --statistics | |
| flake8 backend/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: Type check with mypy | |
| run: mypy backend/ --ignore-missing-imports | |
| - name: Run tests with coverage | |
| run: | | |
| pytest backend/ --cov=backend --cov-report=xml --cov-report=html -v | |
| continue-on-error: true | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: backend-coverage | |
| path: htmlcov/ | |
| retention-days: 7 | |
| frontend: | |
| name: Frontend (Next.js/TypeScript) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: frontend | |
| - name: Check formatting | |
| run: npm run format:check | |
| working-directory: frontend | |
| continue-on-error: true | |
| - name: Lint | |
| run: npm run lint | |
| working-directory: frontend | |
| - name: Type check | |
| run: npm run type-check | |
| working-directory: frontend | |
| - name: Build | |
| run: npm run build | |
| working-directory: frontend | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: frontend-build | |
| path: frontend/.next/ | |
| retention-days: 7 | |
| relayer: | |
| name: Relayer (Rust) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| components: clippy, rustfmt | |
| - name: Cache cargo registry | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| relayer/target | |
| key: ${{ runner.os }}-cargo-relayer-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-relayer- | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| working-directory: relayer | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| working-directory: relayer | |
| - name: Build | |
| run: cargo build --release | |
| working-directory: relayer | |
| - name: Run tests | |
| run: cargo test | |
| working-directory: relayer | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: [smart-contracts, backend] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Cache cargo registry | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| tests/target | |
| key: ${{ runner.os }}-cargo-tests-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-tests- | |
| - name: Run integration tests | |
| if: ${{ hashFiles('tests/Cargo.toml') != '' }} | |
| run: cargo test --manifest-path tests/Cargo.toml --verbose | |
| - name: Skip missing integration crate | |
| if: ${{ hashFiles('tests/Cargo.toml') == '' }} | |
| run: echo "tests/Cargo.toml not present; skipping integration-tests job." | |
| - name: Run stress tests | |
| if: ${{ hashFiles('tests/Cargo.toml') != '' }} | |
| run: cargo test --manifest-path tests/Cargo.toml -- stress --test-threads=1 | |
| code-quality: | |
| name: Code Quality Analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Run CodeQL Init | |
| uses: github/codeql-action/init@v2 | |
| with: | |
| languages: python, javascript, typescript | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v2 | |
| coverage-report: | |
| name: Generate Coverage Report | |
| runs-on: ubuntu-latest | |
| needs: [smart-contracts, backend, frontend] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Generate coverage summary | |
| run: | | |
| echo "## Coverage Report" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Coverage reports have been generated and uploaded as artifacts." >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- Smart Contracts: Run \`cargo test\` locally for coverage" >> $GITHUB_STEP_SUMMARY | |
| echo "- Backend: Check uploaded artifacts for HTML coverage report" >> $GITHUB_STEP_SUMMARY | |
| echo "- Frontend: Run \`npm test\` locally for coverage" >> $GITHUB_STEP_SUMMARY |