diff --git a/.github/workflows/lint.yaml b/.github/workflows/ci.yaml similarity index 78% rename from .github/workflows/lint.yaml rename to .github/workflows/ci.yaml index 74c61e60..5c1dab16 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: Lint & Type Check +name: CI on: pull_request: @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true jobs: - lint: + ci: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -19,6 +19,9 @@ jobs: - name: Setup Nix uses: ./.github/actions/setup-nix + - name: Initialise Nix environment + run: nix develop --command true + - name: Run Lint run: nix develop --command pnpm run lint @@ -27,3 +30,6 @@ jobs: - name: Run Build run: nix develop --command pnpm run build + + - name: Run Tests + run: nix develop --command pnpm test diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index b5e00d77..00000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Tests - -on: - pull_request: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - - name: Setup Nix - uses: ./.github/actions/setup-nix - - - name: Run tests - run: nix develop --command pnpm test diff --git a/flake.nix b/flake.nix index e53e3ad0..3333f05b 100644 --- a/flake.nix +++ b/flake.nix @@ -20,8 +20,11 @@ shellHook = '' echo "StackOne AI Node SDK development environment" - # Install dependencies using lockfile - pnpm install --lockfile + # Install dependencies only if node_modules/.pnpm/lock.yaml is older than pnpm-lock.yaml + if [ ! -f node_modules/.pnpm/lock.yaml ] || [ pnpm-lock.yaml -nt node_modules/.pnpm/lock.yaml ]; then + echo "📦 Installing dependencies..." + pnpm install --frozen-lockfile + fi ''; }; }