|
| 1 | +name: CI - Testcontainers |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test-without-docker: |
| 11 | + name: Tests - Running Outside Container |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout code |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Set up Node.js |
| 19 | + uses: actions/setup-node@v4 |
| 20 | + with: |
| 21 | + node-version: '24' |
| 22 | + cache: 'npm' |
| 23 | + cache-dependency-path: './src/16-docker-outside-of-docker/package.json' |
| 24 | + |
| 25 | + - name: Install dependencies |
| 26 | + working-directory: ./src/16-docker-outside-of-docker |
| 27 | + run: npm install |
| 28 | + |
| 29 | + - name: Run tests - Container reuse without compose (outside container) |
| 30 | + working-directory: ./src/16-docker-outside-of-docker |
| 31 | + env: |
| 32 | + TESTCONTAINERS_RYUK_DISABLED: true |
| 33 | + run: npm run test:without-compose |
| 34 | + |
| 35 | + - name: Run tests - Container reuse with compose (outside container) |
| 36 | + working-directory: ./src/16-docker-outside-of-docker |
| 37 | + env: |
| 38 | + TESTCONTAINERS_RYUK_DISABLED: true |
| 39 | + run: npm run test:with-compose |
| 40 | + |
| 41 | +# test-inside-docker: |
| 42 | +# name: Tests - Running Inside Container (Docker-in-Docker) |
| 43 | +# runs-on: ubuntu-latest |
| 44 | + |
| 45 | +# steps: |
| 46 | +# - name: Checkout code |
| 47 | +# uses: actions/checkout@v4 |
| 48 | + |
| 49 | +# - name: Set up Docker Buildx |
| 50 | +# uses: docker/setup-buildx-action@v3 |
| 51 | + |
| 52 | +# - name: Start test container with docker compose |
| 53 | +# working-directory: ./src/16-docker-outside-of-docker |
| 54 | +# run: docker compose up -d |
| 55 | + |
| 56 | +# - name: Install dependencies inside container |
| 57 | +# working-directory: ./src/16-docker-outside-of-docker |
| 58 | +# run: docker compose exec -T tests npm install |
| 59 | + |
| 60 | +# - name: Run tests - Container reuse without compose (inside container) |
| 61 | +# working-directory: ./src/16-docker-outside-of-docker |
| 62 | +# run: | |
| 63 | +# docker compose exec -T \ |
| 64 | +# -e TESTCONTAINERS_RYUK_DISABLED=true \ |
| 65 | +# tests npm run test:without-compose |
| 66 | + |
| 67 | +# - name: Run tests - Container reuse with compose (inside container) |
| 68 | +# working-directory: ./src/16-docker-outside-of-docker |
| 69 | +# run: | |
| 70 | +# docker compose exec -T \ |
| 71 | +# -e TESTCONTAINERS_RYUK_DISABLED=true \ |
| 72 | +# tests npm run test:with-compose |
| 73 | + |
| 74 | + |
0 commit comments