feat: add Docker configuration for consistent test environment #5
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: Pact Contract Tests | |
| on: | |
| push: | |
| branches: [main, fix/pact-contract-tests] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| contract-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Consumer Contract Tests | |
| run: npm run test:consumer | |
| - name: Run Provider Contract Tests | |
| run: npm run test:provider | |
| - name: Upload Pact files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pact-files-node-${{ matrix.node-version }} | |
| path: __tests__/contract/pacts/ | |
| retention-days: 30 |