From 8caf32dd9d4091e54da0208d32b97114ec0f0bae Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Mon, 4 May 2026 16:50:42 +0800 Subject: [PATCH] split tests in multiple workflows --- .../workflows/{tests.yml => test-komga.yml} | 81 ++----------------- .github/workflows/test-nextui.yml | 62 ++++++++++++++ .github/workflows/test-webui.yml | 37 +++++++++ 3 files changed, 107 insertions(+), 73 deletions(-) rename .github/workflows/{tests.yml => test-komga.yml} (55%) create mode 100644 .github/workflows/test-nextui.yml create mode 100644 .github/workflows/test-webui.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/test-komga.yml similarity index 55% rename from .github/workflows/tests.yml rename to .github/workflows/test-komga.yml index b25ba71f..f33fc6bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/test-komga.yml @@ -1,12 +1,16 @@ -name: Tests +name: Test Komga on: pull_request: paths-ignore: - - 'komga-webui/src/locales/*' + - 'komga-webui/**' - 'komga-tray/src/main/resources/org/gotson/komga/*' - - 'next-ui/i18n/*' + - 'next-ui/**' push: + paths-ignore: + - 'komga-webui/**' + - 'komga-tray/src/main/resources/org/gotson/komga/*' + - 'next-ui/**' branches-ignore: - 'dependabot/**' workflow_dispatch: @@ -18,7 +22,7 @@ jobs: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] fail-fast: false - name: Test server - ${{ matrix.os }} + name: Test Komga - ${{ matrix.os }} steps: - uses: actions/checkout@v6 - name: Setup Java 21 @@ -74,72 +78,3 @@ jobs: with: name: conveyor-required-jdk-modules path: ./output/required-jdk-modules.txt - - webui: - runs-on: ubuntu-latest - name: Test webui builds - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version-file: '.nvmrc' - cache: 'npm' - cache-dependency-path: komga-webui/package-lock.json - - name: npm install - working-directory: komga-webui - run: npm install - - name: npm build - working-directory: komga-webui - run: npm run build - env: - NODE_OPTIONS: "--max-old-space-size=4096" - - name: npm test - working-directory: komga-webui - run: npm run test:unit - - next-ui: - runs-on: ubuntu-latest - name: Test next-ui - steps: - - uses: actions/checkout@v6 - - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'npm' - cache-dependency-path: next-ui/package-lock.json - - - name: npm install - working-directory: next-ui - run: npm ci - - - name: Setup Playwright - uses: ./.github/actions/setup-playwright - with: - working-directory: next-ui - - - name: test:unit - working-directory: next-ui - run: npm run test:unit - - - name: test:storybook - working-directory: next-ui - run: npm run test:storybook - env: - LANG: en_US # fix for https://github.com/microsoft/playwright/issues/34046 - - - name: lint - working-directory: next-ui - run: npm run lint - - - name: prettier - working-directory: next-ui - run: npm run prettier - - - name: type-check - working-directory: next-ui - run: npm run type-check - - - name: build - working-directory: next-ui - run: npm run build-only diff --git a/.github/workflows/test-nextui.yml b/.github/workflows/test-nextui.yml new file mode 100644 index 00000000..194142e7 --- /dev/null +++ b/.github/workflows/test-nextui.yml @@ -0,0 +1,62 @@ +name: Test NextUI + +on: + pull_request: + paths: + - 'next-ui/**' + - '!next-ui/i18n/*' + push: + paths: + - 'next-ui/**' + - '!next-ui/i18n/*' + branches-ignore: + - 'dependabot/**' + workflow_dispatch: + +jobs: + next-ui: + runs-on: ubuntu-latest + name: Test next-ui + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + cache-dependency-path: next-ui/package-lock.json + + - name: npm install + working-directory: next-ui + run: npm ci + + - name: Setup Playwright + uses: ./.github/actions/setup-playwright + with: + working-directory: next-ui + + - name: test:unit + working-directory: next-ui + run: npm run test:unit + + - name: test:storybook + working-directory: next-ui + run: npm run test:storybook + env: + LANG: en_US # fix for https://github.com/microsoft/playwright/issues/34046 + + - name: lint + working-directory: next-ui + run: npm run lint + + - name: prettier + working-directory: next-ui + run: npm run prettier + + - name: type-check + working-directory: next-ui + run: npm run type-check + + - name: build + working-directory: next-ui + run: npm run build-only diff --git a/.github/workflows/test-webui.yml b/.github/workflows/test-webui.yml new file mode 100644 index 00000000..16944320 --- /dev/null +++ b/.github/workflows/test-webui.yml @@ -0,0 +1,37 @@ +name: Test WebUI + +on: + pull_request: + paths: + - 'komga-webui/**' + - '!komga-webui/src/locales/*' + push: + paths: + - 'komga-webui/**' + - '!komga-webui/src/locales/*' + branches-ignore: + - 'dependabot/**' + workflow_dispatch: + +jobs: + webui: + runs-on: ubuntu-latest + name: Test webui + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version-file: '.nvmrc' + cache: 'npm' + cache-dependency-path: komga-webui/package-lock.json + - name: npm install + working-directory: komga-webui + run: npm install + - name: npm build + working-directory: komga-webui + run: npm run build + env: + NODE_OPTIONS: "--max-old-space-size=4096" + - name: npm test + working-directory: komga-webui + run: npm run test:unit