|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, develop] |
| 6 | + pull_request: |
| 7 | + branches: [main, develop] |
| 8 | + |
| 9 | +jobs: |
| 10 | + unit-tests: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Setup Node.js |
| 16 | + uses: actions/setup-node@v4 |
| 17 | + with: |
| 18 | + node-version: '18' |
| 19 | + cache: 'npm' |
| 20 | + cache-dependency-path: frontend/package-lock.json |
| 21 | + |
| 22 | + - name: Install dependencies |
| 23 | + run: cd frontend && npm ci |
| 24 | + |
| 25 | + - name: Run unit tests |
| 26 | + run: cd frontend && npm test -- --coverage |
| 27 | + |
| 28 | + - name: Upload coverage |
| 29 | + uses: codecov/codecov-action@v3 |
| 30 | + with: |
| 31 | + directory: ./frontend/coverage |
| 32 | + |
| 33 | + e2e-tests: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + |
| 38 | + - name: Setup Node.js |
| 39 | + uses: actions/setup-node@v4 |
| 40 | + with: |
| 41 | + node-version: '18' |
| 42 | + cache: 'npm' |
| 43 | + cache-dependency-path: frontend/package-lock.json |
| 44 | + |
| 45 | + - name: Install dependencies |
| 46 | + run: cd frontend && npm ci |
| 47 | + |
| 48 | + - name: Install Playwright |
| 49 | + run: npx playwright install --with-deps |
| 50 | + |
| 51 | + - name: Run E2E tests |
| 52 | + run: npx playwright test |
| 53 | + |
| 54 | + - name: Upload test results |
| 55 | + if: always() |
| 56 | + uses: actions/upload-artifact@v3 |
| 57 | + with: |
| 58 | + name: playwright-report |
| 59 | + path: playwright-report/ |
| 60 | + |
| 61 | + contract-tests: |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v4 |
| 65 | + |
| 66 | + - name: Setup Node.js |
| 67 | + uses: actions/setup-node@v4 |
| 68 | + with: |
| 69 | + node-version: '18' |
| 70 | + cache: 'npm' |
| 71 | + |
| 72 | + - name: Install dependencies |
| 73 | + run: npm ci |
| 74 | + |
| 75 | + - name: Run Hardhat tests |
| 76 | + run: npx hardhat test |
| 77 | + |
| 78 | + - name: Generate coverage |
| 79 | + run: npx hardhat coverage |
0 commit comments