Local wiremock #208
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Online Shop | |
| on: | |
| push: | |
| branches: [ "**" ] | |
| jobs: | |
| build-client: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: customer-client | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| cache-dependency-path: customer-client/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check Prettier formatting | |
| run: npm run format:check | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| test-client: | |
| runs-on: ubuntu-latest | |
| needs: build-client | |
| defaults: | |
| run: | |
| working-directory: customer-client | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| cache-dependency-path: customer-client/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Start WireMock | |
| run: docker compose up -d wiremock | |
| working-directory: . | |
| - name: Wait for WireMock | |
| run: | | |
| until curl -sf http://localhost:8080/__admin/health > /dev/null; do | |
| echo "Waiting for WireMock..." | |
| sleep 2 | |
| done | |
| working-directory: . | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright tests with WireMock | |
| run: npm run test:wiremock | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-report-wiremock | |
| path: customer-client/playwright-report/ | |
| - name: Stop WireMock | |
| if: always() | |
| run: docker compose down | |
| working-directory: . | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: build-client | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| cache-dependency-path: customer-client/package-lock.json | |
| - name: Install customer-client dependencies | |
| run: npm ci | |
| working-directory: customer-client | |
| - name: Build customer-client | |
| run: npm run build | |
| working-directory: customer-client | |
| - name: Build customer-service | |
| run: mvn clean package -f customer-service/pom.xml -Dservice.name=customer-service | |
| - name: Build billing-service | |
| run: mvn clean package -f billing-service/pom.xml -Dservice.name=billing-service | |
| - name: Build delivery-service | |
| run: mvn clean package -f delivery-service/pom.xml -Dservice.name=delivery-service | |
| - name: Build address-validation-service | |
| run: mvn clean package -f address-validation-service/pom.xml -Dservice.name=address-validation-service | |
| - name: Build with Docker | |
| run: docker compose build | |
| - name: Start with Docker | |
| run: docker compose up -d | |
| - name: Wait for customer-service | |
| run: | | |
| until curl -sf http://localhost:8181/customers/ > /dev/null; do | |
| echo "Waiting for customer-service..." | |
| sleep 2 | |
| done | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| working-directory: customer-client | |
| - name: Run Playwright tests | |
| run: npm run test | |
| working-directory: customer-client | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-report | |
| path: customer-client/playwright-report/ | |
| - name: Stop Docker Containers | |
| if: always() | |
| run: docker compose down |