From dd2e0f60e4cd651e39bcf27284d7485884f01c25 Mon Sep 17 00:00:00 2001 From: Kar Rui Lau Date: Fri, 11 Oct 2024 18:23:09 +0800 Subject: [PATCH] feat(ci): load env with github action, run test:ci script --- .github/workflows/ci.yml | 6 +++++- package.json | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca3e49515..07e7f8031 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,10 @@ jobs: key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} - run: npm ci - run: npm run test:docker + - name: Load .env file + uses: xom9ikk/dotenv@v2 + with: + mode: test # Not using Datadog Test Visibility action since we need to use the local # (patched) package for it to work with neverthrow - name: run tests @@ -99,7 +103,7 @@ jobs: DD_SERVICE: isomer DD_API_KEY: ${{ secrets.DD_API_KEY }} DD_CIVISIBILITY_AUTO_INSTRUMENTATION_PROVIDER: github - run: . .env.test && npx jest -- --runInBand --coverage + run: npm run test:ci gatekeep: name: Determine if Build & Deploy is needed diff --git a/package.json b/package.json index 5a8ebf5fb..bd6b42f8d 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "dev": "source .env && docker compose -f docker-compose.dev.yml up", "test:docker": "docker run -d -p 54321:5432 --name postgres -e POSTGRES_USER=isomer -e POSTGRES_PASSWORD=password -e POSTGRES_DB=isomercms_test postgres:latest", "test": "source .env.test && jest --runInBand", + "test:ci": "jest --runInBand --coverage", "release": "bash scripts/release_prep.sh", "lint": "npx eslint .", "lint-fix": "eslint --ignore-path .gitignore . --fix",