|
| 1 | +name: Integration CI |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + |
| 5 | +env: |
| 6 | + CARGO_TERM_COLOR: always |
| 7 | + CARGO_INCREMENTAL: 0 |
| 8 | + |
| 9 | +jobs: |
| 10 | + int-tests: |
| 11 | + runs-on: ubuntu-latest-16-cores |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + with: |
| 15 | + fetch-depth: 0 |
| 16 | + submodules: 'recursive' |
| 17 | + - uses: DeterminateSystems/nix-installer-action@v14 |
| 18 | + - uses: DeterminateSystems/magic-nix-cache-action@v8 |
| 19 | + - name: Pre-populate nix-shell |
| 20 | + run: | |
| 21 | + export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r) |
| 22 | + echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV |
| 23 | + nix-shell --run "echo" shell.nix |
| 24 | + - name: Handle Rust dependencies caching |
| 25 | + uses: Swatinem/rust-cache@v2 |
| 26 | + with: |
| 27 | + save-if: ${{ startsWith(github.ref_name, 'release/') || github.ref_name == 'develop' || github.ref_name == 'ci' }} |
| 28 | + - name: Build rust binaries |
| 29 | + run: nix-shell --run "cargo build --bins" |
| 30 | + - name: Build the tests |
| 31 | + run: nix-shell --run "./scripts/rust/test.sh --no-run" |
| 32 | + - name: Setup Test Pre-Requisites |
| 33 | + run: | |
| 34 | + sudo sysctl -w vm.nr_hugepages=2560 |
| 35 | + sudo apt-get install linux-modules-extra-$(uname -r) |
| 36 | + sudo modprobe nvme_tcp |
| 37 | + - name: Run Tests |
| 38 | + run: | |
| 39 | + # pre-pull the required container images |
| 40 | + deployer start --image-pull-policy always -w 60s && deployer stop |
| 41 | + # includes both unit and integration tests |
| 42 | + nix-shell --run "./scripts/rust/test.sh" |
| 43 | + - name: Cleanup |
| 44 | + if: always() |
| 45 | + run: nix-shell --run "./scripts/rust/deployer-cleanup.sh" |
| 46 | +# debugging |
| 47 | + - name: Setup tmate session |
| 48 | + if: ${{ failure() }} |
| 49 | + timeout-minutes: 120 |
| 50 | + uses: mxschmitt/action-tmate@v3 |
0 commit comments