diff --git a/.github/workflows/monkey-ci.yml b/.github/workflows/monkey-ci.yml index 21252fdf4120..0d97fb981468 100644 --- a/.github/workflows/monkey-ci.yml +++ b/.github/workflows/monkey-ci.yml @@ -160,6 +160,17 @@ jobs: - name: Install dependencies run: pnpm install + - name: Cache testcontainers images + id: cache-testcontainers + uses: AndreKurait/docker-cache@0.6.0 + with: + key: ${{ runner.os }}-testcontainers-mongo-5.0.13-redis-6.2.6 + + - name: Pull testcontainers images + run: | + docker pull mongo:5.0.13 + docker pull redis:6.2.6 + - name: Check lint run: npm run lint-be diff --git a/backend/__tests__/__integration__/global-setup.ts b/backend/__tests__/__integration__/global-setup.ts index 75a4f2865c07..d6f1f30f8f9c 100644 --- a/backend/__tests__/__integration__/global-setup.ts +++ b/backend/__tests__/__integration__/global-setup.ts @@ -7,6 +7,7 @@ export async function setup(): Promise { process.env.TZ = "UTC"; //use testcontainer to start mongodb + //make sure to update the image version in monkey-ci.yml if you change it here const mongoContainer = new GenericContainer("mongo:5.0.13") .withExposedPorts(27017) .withWaitStrategy(Wait.forListeningPorts()); @@ -19,6 +20,7 @@ export async function setup(): Promise { process.env["TEST_DB_URL"] = mongoUrl; //use testcontainer to start redis + //make sure to update the image version in monkey-ci.yml if you change it here const redisContainer = new GenericContainer("redis:6.2.6") .withExposedPorts(6379) .withWaitStrategy(Wait.forLogMessage("Ready to accept connections"));