|
| 1 | +name: CI (UI, self-hosted) |
| 2 | + |
| 3 | +# these are the same as ui-ci.yml, but with self-hosted runners |
| 4 | +# the runners come with pre-installed Playwright browsers version: 1.56.1 |
| 5 | +# the jobs are much lighter because they don't need to install node and playwright browsers |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + sha: |
| 11 | + description: 'Commit SHA1 to build' |
| 12 | + required: false |
| 13 | + type: string |
| 14 | + push: |
| 15 | + branches: |
| 16 | + - master |
| 17 | + paths: [ |
| 18 | + '.github/workflows/ui-ci-self-hosted.yml', |
| 19 | + '.github/workflows/ui-build.yml', |
| 20 | + 'tools/ui/**.*', |
| 21 | + 'tools/server/tests/**.*' |
| 22 | + ] |
| 23 | + pull_request: |
| 24 | + types: [opened, synchronize, reopened] |
| 25 | + paths: [ |
| 26 | + '.github/workflows/ui-ci-self-hosted.yml', |
| 27 | + '.github/workflows/ui-build.yml', |
| 28 | + 'tools/ui/**.*', |
| 29 | + 'tools/server/tests/**.*' |
| 30 | + ] |
| 31 | + |
| 32 | +env: |
| 33 | + LLAMA_LOG_COLORS: 1 |
| 34 | + LLAMA_LOG_PREFIX: 1 |
| 35 | + LLAMA_LOG_TIMESTAMPS: 1 |
| 36 | + LLAMA_LOG_VERBOSITY: 10 |
| 37 | + |
| 38 | +concurrency: |
| 39 | + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} |
| 40 | + cancel-in-progress: true |
| 41 | + |
| 42 | +jobs: |
| 43 | + ui-build: |
| 44 | + name: Build static output |
| 45 | + uses: ./.github/workflows/ui-build.yml |
| 46 | + |
| 47 | + ui-checks: |
| 48 | + name: UI Checks |
| 49 | + needs: ui-build |
| 50 | + runs-on: [self-hosted, PLAYWRIGHT] |
| 51 | + continue-on-error: true |
| 52 | + steps: |
| 53 | + - name: Checkout code |
| 54 | + uses: actions/checkout@v6 |
| 55 | + with: |
| 56 | + fetch-depth: 0 |
| 57 | + ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }} |
| 58 | + |
| 59 | + - name: Install dependencies |
| 60 | + id: setup |
| 61 | + run: npm ci |
| 62 | + working-directory: tools/ui |
| 63 | + |
| 64 | + - name: Run type checking |
| 65 | + if: ${{ always() && steps.setup.conclusion == 'success' }} |
| 66 | + run: npm run check |
| 67 | + working-directory: tools/ui |
| 68 | + |
| 69 | + - name: Run linting |
| 70 | + if: ${{ always() && steps.setup.conclusion == 'success' }} |
| 71 | + run: npm run lint |
| 72 | + working-directory: tools/ui |
| 73 | + |
| 74 | + - name: Run Client tests |
| 75 | + if: ${{ always() }} |
| 76 | + run: npm run test:client |
| 77 | + working-directory: tools/ui |
| 78 | + |
| 79 | + - name: Run Unit tests |
| 80 | + if: ${{ always() }} |
| 81 | + run: npm run test:unit |
| 82 | + working-directory: tools/ui |
| 83 | + |
| 84 | + e2e-tests: |
| 85 | + name: E2E Tests |
| 86 | + needs: ui-build |
| 87 | + runs-on: [self-hosted, PLAYWRIGHT] |
| 88 | + steps: |
| 89 | + - name: Checkout code |
| 90 | + uses: actions/checkout@v6 |
| 91 | + with: |
| 92 | + fetch-depth: 0 |
| 93 | + ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }} |
| 94 | + |
| 95 | + - name: Install dependencies |
| 96 | + id: setup |
| 97 | + run: npm ci |
| 98 | + working-directory: tools/ui |
| 99 | + |
| 100 | + - name: Build application |
| 101 | + if: ${{ always() && steps.setup.conclusion == 'success' }} |
| 102 | + run: npm run build |
| 103 | + working-directory: tools/ui |
| 104 | + |
| 105 | + - name: Build Storybook |
| 106 | + if: ${{ always() }} |
| 107 | + run: npm run build-storybook |
| 108 | + working-directory: tools/ui |
| 109 | + |
| 110 | + - name: Run UI tests |
| 111 | + if: ${{ always() }} |
| 112 | + run: npm run test:ui -- --testTimeout=60000 |
| 113 | + working-directory: tools/ui |
| 114 | + |
| 115 | + - name: Run E2E tests |
| 116 | + if: ${{ always() }} |
| 117 | + run: npm run test:e2e |
| 118 | + working-directory: tools/ui |
0 commit comments