Add build pipeline and address vulnerabilities for data_cache #1
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: Unit and Integration Test - Rust | |
| on: | |
| - push | |
| - pull_request | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| if: ${{ github.repository == 'kubeflow/trainer' }} | |
| defaults: | |
| run: | |
| working-directory: pkg/data_cache | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Cache Rust dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| pkg/data_cache/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('pkg/data_cache/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Run Rust unit tests | |
| run: make test-rust |