char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Sigbjørn Skjæretci : disable npm gha cache (#28600)03fa73cb2

char/aliceai-t5-moe
4.3 KiB153 linesraw
1name: UI
2
3on:
4  workflow_dispatch:
5    inputs:
6      sha:
7        description: 'Commit SHA1 to build'
8        required: false
9        type: string
10  push:
11    branches:
12      - master
13    paths: [
14      '.github/workflows/ui.yml',
15      '.github/workflows/ui-build.yml',
16      'tools/ui/**.*',
17      'tools/server/tests/**.*'
18    ]
19  pull_request:
20    types: [opened, synchronize, reopened]
21    paths: [
22      '.github/workflows/ui.yml',
23      '.github/workflows/ui-build.yml',
24      'tools/ui/**.*',
25      'tools/server/tests/**.*'
26    ]
27
28env:
29  LLAMA_ARG_LOG_COLORS: 1
30  LLAMA_ARG_LOG_PREFIX: 1
31  LLAMA_ARG_LOG_TIMESTAMPS: 1
32  LLAMA_ARG_LOG_VERBOSITY: 10
33
34concurrency:
35  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
36  cancel-in-progress: true
37
38jobs:
39  ui-build:
40    name: Build static output
41    uses: ./.github/workflows/ui-build.yml
42
43  ui-checks:
44    name: Checks
45    needs: ui-build
46    runs-on: ubuntu-24.04
47    continue-on-error: true
48    steps:
49      - name: Checkout code
50        uses: actions/checkout@v6
51        with:
52          fetch-depth: 0
53          ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
54
55      - name: Setup Node.js
56        id: node
57        uses: actions/setup-node@v6
58        with:
59          node-version: "24"
60          # cache: "npm"
61          # cache-dependency-path: "tools/ui/package-lock.json"
62          package-manager-cache: false
63
64      - name: Download built UI artifacts
65        uses: actions/download-artifact@v6
66        with:
67          name: llama-ui.zip
68          path: tools/ui/dist/
69
70      - name: Install dependencies
71        id: setup
72        if: ${{ steps.node.conclusion == 'success' }}
73        run: npm ci
74        working-directory: tools/ui
75
76      - name: Run type checking
77        if: ${{ always() && steps.setup.conclusion == 'success' }}
78        run: npm run check
79        working-directory: tools/ui
80
81      - name: Run linting
82        if: ${{ always() && steps.setup.conclusion == 'success' }}
83        run: npm run lint
84        working-directory: tools/ui
85
86      - name: Install Playwright browsers
87        id: playwright
88        if: ${{ always() && steps.setup.conclusion == 'success' }}
89        run: npx playwright install --with-deps
90        working-directory: tools/ui
91
92      - name: Run Client tests
93        if: ${{ always() && steps.playwright.conclusion == 'success' }}
94        run: npm run test:client
95        working-directory: tools/ui
96
97      - name: Run Unit tests (uses pre-built dist/ from ui-build)
98        if: ${{ always() && steps.playwright.conclusion == 'success' }}
99        run: npm run test:unit
100        working-directory: tools/ui
101
102  e2e-tests:
103    name: E2E Tests
104    needs: ui-build
105    runs-on: ubuntu-24.04
106    steps:
107      - name: Checkout code
108        uses: actions/checkout@v6
109        with:
110          fetch-depth: 0
111          ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }}
112
113      - name: Setup Node.js
114        id: node
115        uses: actions/setup-node@v6
116        with:
117          node-version: "24"
118          # cache: "npm"
119          # cache-dependency-path: "tools/ui/package-lock.json"
120          package-manager-cache: false
121
122      - name: Install dependencies
123        id: setup
124        if: ${{ steps.node.conclusion == 'success' }}
125        run: npm ci
126        working-directory: tools/ui
127
128      - name: Download built UI artifacts (reuses ui-build)
129        uses: actions/download-artifact@v6
130        with:
131          name: llama-ui.zip
132          path: tools/ui/dist/
133
134      - name: Install Playwright browsers
135        id: playwright
136        if: ${{ always() && steps.setup.conclusion == 'success' }}
137        run: npx playwright install --with-deps
138        working-directory: tools/ui
139
140      - name: Build Storybook
141        if: ${{ always() && steps.playwright.conclusion == 'success' }}
142        run: npm run build-storybook
143        working-directory: tools/ui
144
145      - name: Run UI tests
146        if: ${{ always() && steps.playwright.conclusion == 'success' }}
147        run: npm run test:ui -- --testTimeout=60000
148        working-directory: tools/ui
149
150      - name: Run E2E tests (uses pre-built dist/ from ui-build)
151        if: ${{ always() && steps.playwright.conclusion == 'success' }}
152        run: npm run test:e2e
153        working-directory: tools/ui