Implement checkout-service #204
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: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build onlineshop | |
| run: mvn clean package -f online-shop/pom.xml | |
| - name: Build with Docker | |
| run: docker compose build | |
| - name: Start Docker services | |
| run: docker compose up -d | |
| - name: Wait for online shop | |
| run: until curl -sf http://localhost/index.html; do sleep 2; done | |
| timeout-minutes: 2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| cache-dependency-path: golden-master-tests/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: golden-master-tests | |
| - name: Check formatting | |
| run: npm run format:check | |
| working-directory: golden-master-tests | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| working-directory: golden-master-tests | |
| - name: Run Playwright tests | |
| run: npm test --grep-invert 'should checkout' | |
| working-directory: golden-master-tests | |
| env: | |
| ONLINE_SHOP_URL: http://localhost | |
| - name: Stop Docker services | |
| if: always() | |
| run: docker compose down |