diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2694863..6d06f92 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,14 +19,15 @@ jobs: - name: Build and push uses: docker/build-push-action@v2 with: + tags: cupcakearmy/cryptgeon:test push: false test: runs-on: ubuntu-latest - services: - redis: - image: redis:7-alpine - ports: - - 6379:6379 + # services: + # redis: + # image: redis:7-alpine + # ports: + # - 6379:6379 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 @@ -35,19 +36,18 @@ jobs: - uses: pnpm/action-setup@v2 with: version: 7 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.64 + # - uses: actions-rs/toolchain@v1 + # with: + # toolchain: 1.64 - name: Prepare run: | pnpm install - pnpm run test:prepare + pnpm run test:docker - name: Install Playwright run: npx playwright install --with-deps - name: Run your tests run: pnpm run test:run - name: Upload test results - if: always() uses: actions/upload-artifact@v2 with: name: test-results diff --git a/docker-compose.yml b/docker-compose.dev.yaml similarity index 70% rename from docker-compose.yml rename to docker-compose.dev.yaml index 4fd6bf9..ae65fc8 100644 --- a/docker-compose.yml +++ b/docker-compose.dev.yaml @@ -10,11 +10,9 @@ services: - 6379:6379 app: - # build: . - image: cupcakearmy/cryptgeon + build: . + env_file: .env depends_on: - redis - environment: - SIZE_LIMIT: 10 MiB ports: - 1234:5000 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..e3869e9 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,18 @@ +version: '3.8' + +services: + redis: + image: redis:7-alpine + # Set a size limit. See link below on how to customise. + # https://redis.io/docs/manual/eviction/ + # command: redis-server --maxmemory 1gb --maxmemory-policy allkeys-lru + + app: + image: cupcakearmy/cryptgeon:latest + depends_on: + - redis + environment: + # Size limit for a single note. + SIZE_LIMIT: 4 MiB + ports: + - 80:5000 diff --git a/package.json b/package.json index 617df09..9cc5a72 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "test:run": "playwright test --project chrome firefox safari", "test:local": "playwright test --project local", "test:server": "pnpm --parallel run test:server", - "test:prepare": "pnpm --parallel run test:prepare" + "test:prepare": "pnpm --parallel run test:prepare", + "test:docker": "docker compose -f docker-compose.dev.yaml build" }, "devDependencies": { "@playwright/test": "^1.25.1", diff --git a/playwright.config.ts b/playwright.config.ts index 2cd9591..bb78140 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -10,10 +10,10 @@ const config: PlaywrightTestConfig = { outputDir: './test-results', testDir: './test', timeout: 60_000, - testIgnore: ['file/too-big.spec.ts'], + // testIgnore: ['file/too-big.spec.ts'], webServer: { - command: 'pnpm run test:server', + command: 'docker compose -f docker-compose.dev.yaml up', port: 1234, reuseExistingServer: true, },