feat(rev): rev-list and rev-parse #815
Workflow file for this run
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
| on: | |
| pull_request: | |
| paths-ignore: | |
| - '.github/**' | |
| - 'docs/**' | |
| name: Check, Build and Test | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| format: | |
| name: Rustfmt Check | |
| runs-on: [self-hosted] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Install nightly toolchain | |
| run: | | |
| rustup toolchain install nightly --profile minimal | |
| rustup component add rustfmt --toolchain nightly | |
| - name: Run rustfmt | |
| run: cargo +nightly fmt --all --check | |
| clippy: | |
| name: Clippy Check | |
| strategy: | |
| fail-fast: true | |
| runs-on: [self-hosted] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTUP_TOOLCHAIN: stable | |
| LIBRA_SKIP_WEB_BUILD: "1" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: "22" | |
| - name: Enable pnpm | |
| run: corepack enable | |
| - name: Run cargo clippy | |
| run: cargo clippy -- -D warnings | |
| redundancy: | |
| name: Redundancy Check | |
| runs-on: [self-hosted] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Run redundancy check | |
| run: | | |
| x=$(find third-party/rust/crates -mindepth 2 -maxdepth 2 -type d -exec bash -c ' | |
| n=$(find "$1" -maxdepth 1 -type f | wc -l) | |
| [ $n -gt 1 ] | |
| ' _ {} \; -print -quit | wc -l) | |
| if [ $x -gt 0 ]; then | |
| echo "❌ Redundant directories found" | |
| exit 1 | |
| else | |
| echo "✅ All good" | |
| exit 0 | |
| fi | |
| test: | |
| name: Run Tests | |
| runs-on: [self-hosted] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTUP_TOOLCHAIN: stable | |
| LIBRA_SKIP_WEB_BUILD: "1" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: "22" | |
| - name: Enable pnpm | |
| run: corepack enable | |
| - name: Ensure ripgrep is available | |
| shell: bash | |
| run: | | |
| if command -v rg >/dev/null 2>&1; then | |
| rg --version | |
| exit 0 | |
| fi | |
| if [ "$(id -u)" -eq 0 ]; then | |
| SUDO="" | |
| elif command -v sudo >/dev/null 2>&1; then | |
| SUDO="sudo" | |
| else | |
| SUDO="" | |
| fi | |
| if command -v apt-get >/dev/null 2>&1; then | |
| $SUDO apt-get update | |
| $SUDO apt-get install -y ripgrep | |
| elif command -v dnf >/dev/null 2>&1; then | |
| $SUDO dnf install -y ripgrep | |
| elif command -v yum >/dev/null 2>&1; then | |
| $SUDO yum install -y ripgrep | |
| elif command -v brew >/dev/null 2>&1; then | |
| brew install ripgrep | |
| else | |
| cargo install ripgrep --locked | |
| echo "${HOME}/.cargo/bin" >> "$GITHUB_PATH" | |
| fi | |
| command -v rg | |
| rg --version | |
| - name: Run tests (L1 + L2 + L3) | |
| env: | |
| LIBRA_TEST_GITHUB_TOKEN: ${{ secrets.LIBRA_TEST_GITHUB_TOKEN }} | |
| LIBRA_TEST_GITHUB_NAMESPACE: ${{ secrets.LIBRA_TEST_GITHUB_NAMESPACE }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| LIBRA_D1_ACCOUNT_ID: ${{ secrets.LIBRA_D1_ACCOUNT_ID }} | |
| LIBRA_D1_API_TOKEN: ${{ secrets.LIBRA_D1_API_TOKEN }} | |
| LIBRA_D1_DATABASE_ID: ${{ secrets.LIBRA_D1_DATABASE_ID }} | |
| LIBRA_STORAGE_ENDPOINT: ${{ secrets.LIBRA_STORAGE_ENDPOINT }} | |
| LIBRA_STORAGE_BUCKET: ${{ secrets.LIBRA_STORAGE_BUCKET }} | |
| LIBRA_STORAGE_ACCESS_KEY: ${{ secrets.LIBRA_STORAGE_ACCESS_KEY }} | |
| LIBRA_STORAGE_SECRET_KEY: ${{ secrets.LIBRA_STORAGE_SECRET_KEY }} | |
| run: cargo test --all |