|
| 1 | +name: Relay Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - 'relay/**' |
| 7 | + - 'meta_configurator/e2e/**' |
| 8 | + - 'meta_configurator/src/**' |
| 9 | + - 'meta_configurator/package.json' |
| 10 | + - 'meta_configurator/package-lock.json' |
| 11 | + - 'tests/shared/**' |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + relay-tests: |
| 16 | + name: Relay tests |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - uses: actions/setup-python@v5 |
| 22 | + with: |
| 23 | + python-version: '3.12' |
| 24 | + |
| 25 | + - name: Install relay dependencies |
| 26 | + working-directory: ./relay |
| 27 | + run: pip install -r requirements.txt -r requirements-dev.txt |
| 28 | + |
| 29 | + - name: Run relay Python tests |
| 30 | + working-directory: ./relay |
| 31 | + run: pytest tests/ -v |
| 32 | + |
| 33 | + - name: Set up Docker Buildx |
| 34 | + uses: docker/setup-buildx-action@v4 |
| 35 | + |
| 36 | + - name: Set up Docker Compose |
| 37 | + uses: docker/setup-compose-action@v2 |
| 38 | + |
| 39 | + - name: Show Docker tool versions |
| 40 | + run: | |
| 41 | + docker version |
| 42 | + docker buildx version |
| 43 | + docker compose version |
| 44 | +
|
| 45 | + - name: Run relay Docker smoke tests |
| 46 | + run: bash relay/tests/test_docker.sh |
| 47 | + |
| 48 | + - uses: actions/setup-node@v3 |
| 49 | + with: |
| 50 | + node-version: '18' |
| 51 | + |
| 52 | + - name: Cache npm dependencies |
| 53 | + uses: actions/cache@v3 |
| 54 | + with: |
| 55 | + path: | |
| 56 | + meta_configurator/node_modules |
| 57 | + key: ${{ runner.os }}-node-${{ hashFiles('meta_configurator/package-lock.json') }} |
| 58 | + restore-keys: | |
| 59 | + ${{ runner.os }}-node- |
| 60 | +
|
| 61 | + - name: Cache Playwright browsers |
| 62 | + uses: actions/cache@v3 |
| 63 | + with: |
| 64 | + path: ~/.cache/ms-playwright |
| 65 | + key: ${{ runner.os }}-playwright-${{ hashFiles('meta_configurator/package-lock.json') }} |
| 66 | + restore-keys: | |
| 67 | + ${{ runner.os }}-playwright- |
| 68 | +
|
| 69 | + - name: Install MetaConfigurator dependencies |
| 70 | + working-directory: ./meta_configurator |
| 71 | + run: npm ci |
| 72 | + |
| 73 | + - name: Build MetaConfigurator |
| 74 | + working-directory: ./meta_configurator |
| 75 | + run: npm run build --if-present |
| 76 | + |
| 77 | + - name: Install Playwright browsers |
| 78 | + working-directory: ./meta_configurator |
| 79 | + run: npx playwright install --with-deps |
| 80 | + |
| 81 | + - name: Start dev server and run relay E2E tests |
| 82 | + working-directory: ./meta_configurator |
| 83 | + run: npx start-server-and-test dev http://localhost:5173 test:e2e:relay |
| 84 | + |
| 85 | + - name: Upload relay Playwright HTML report |
| 86 | + if: always() |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: playwright-report-relay |
| 90 | + path: ${{ github.workspace }}/meta_configurator/playwright-report/ |
0 commit comments