From c0f725cc126b0337643aa25e79e90ff31e497a77 Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Tue, 30 Apr 2024 18:09:47 +0530 Subject: [PATCH] feat: use nix for gh actions test --- .github/workflows/test-e2e.yml | 22 +++++----------------- .github/workflows/test-integration.yml | 25 +++++-------------------- 2 files changed, 10 insertions(+), 37 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 187e8454..ca612f1c 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -9,24 +9,12 @@ jobs: name: End to End Test runs-on: ubuntu-latest steps: - - name: Setup BATS - uses: mig4/setup-bats@v1 - with: - bats-version: 1.9.0 - - name: Install protoc dependencies for prost-wkt-types - run: sudo apt-get install -y protobuf-compiler libprotobuf-dev + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v4 + - name: Run the Magic Nix Cache + uses: DeterminateSystems/magic-nix-cache-action@v2 - uses: actions/checkout@v3 - - name: Setup cache for cargo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- - name: Run e2e tests env: PG_CON: postgres://user:password@127.0.0.1:5432/pg - run: make e2e + run: nix develop -c make e2e diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 10db9031..9f56f43f 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -9,27 +9,12 @@ jobs: name: Integration Test runs-on: ubuntu-latest steps: + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v4 + - name: Run the Magic Nix Cache + uses: DeterminateSystems/magic-nix-cache-action@v2 - uses: actions/checkout@v3 - - name: Install sqlx-cli - uses: baptiste0928/cargo-install@v2 - with: - crate: sqlx-cli - version: "^0.7.1" - - name: Install nextest - uses: baptiste0928/cargo-install@v2 - with: - crate: cargo-nextest - - name: Setup cache for cargo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- - name: Run integration tests env: PG_CON: postgres://user:password@127.0.0.1:5432/pg - run: make test-in-ci + run: nix develop -c make test-in-ci