mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-23 18:26:55 +00:00
* chore(deps): bump the dependencies group across 1 directory with 22 updates Bumps the dependencies group with 22 updates in the /src/frontend directory: | Package | From | To | | --- | --- | --- | | [@codemirror/lang-liquid](https://github.com/codemirror/lang-liquid) | `6.3.2` | `6.3.3` | | [@codemirror/language](https://github.com/codemirror/language) | `6.12.4` | `6.13.1` | | [@codemirror/state](https://github.com/codemirror/state) | `6.7.2` | `6.7.6` | | [@codemirror/view](https://github.com/codemirror/view) | `6.43.10` | `6.43.14` | | [@sentry/react](https://github.com/getsentry/sentry-javascript) | `10.73.0` | `11.5.0` | | [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) | `3.46.0` | `3.49.0` | | [@tanstack/react-query](https://github.com/TanStack/query/tree/HEAD/packages/react-query) | `5.102.8` | `5.104.1` | | [@uiw/codemirror-theme-vscode](https://github.com/uiwjs/react-codemirror) | `4.25.11` | `4.25.12` | | [@uiw/react-codemirror](https://github.com/uiwjs/react-codemirror) | `4.25.11` | `4.25.12` | | [@vanilla-extract/css](https://github.com/vanilla-extract-css/vanilla-extract/tree/HEAD/packages/css) | `1.21.2` | `1.21.3` | | [react-hook-form](https://github.com/react-hook-form/react-hook-form) | `7.87.0` | `7.89.0` | | [react-is](https://github.com/react/react/tree/HEAD/packages/react-is) | `19.2.8` | `19.3.0` | | [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) | `8.0.1` | `8.0.7` | | [@babel/preset-typescript](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-typescript) | `8.0.1` | `8.0.7` | | [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) | `8.0.0` | `8.0.7` | | [@playwright/test](https://github.com/microsoft/playwright) | `1.62.1` | `1.64.0` | | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.4.0` | `26.6.4` | | [oauth2-mock-server](https://github.com/axa-group/oauth2-mock-server) | `9.1.0` | `9.2.0` | | [otpauth](https://github.com/hectorm/otpauth) | `9.5.1` | `9.5.2` | | [rollup](https://github.com/rollup/rollup) | `4.63.1` | `4.64.2` | | [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `7.3.6` | `7.3.7` | | [vite-plugin-dts](https://github.com/qmhc/unplugin-dts/tree/HEAD/packages/vite-plugin-dts) | `5.0.3` | `5.1.2` | Updates `@codemirror/lang-liquid` from 6.3.2 to 6.3.3 - [Changelog](https://github.com/codemirror/lang-liquid/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/lang-liquid/commits) Updates `@codemirror/language` from 6.12.4 to 6.13.1 - [Changelog](https://github.com/codemirror/language/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/language/commits) Updates `@codemirror/state` from 6.7.2 to 6.7.6 - [Changelog](https://github.com/codemirror/state/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/state/commits) Updates `@codemirror/view` from 6.43.10 to 6.43.14 - [Changelog](https://github.com/codemirror/view/blob/main/CHANGELOG.md) - [Commits](https://github.com/codemirror/view/commits) Updates `@sentry/react` from 10.73.0 to 11.5.0 - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/10.73.0...11.5.0) Updates `@tabler/icons-react` from 3.46.0 to 3.49.0 - [Release notes](https://github.com/tabler/tabler-icons/releases) - [Changelog](https://github.com/tabler/tabler-icons/blob/main/packages/icons-react/CHANGELOG.md) - [Commits](https://github.com/tabler/tabler-icons/commits/v3.49.0/packages/icons-react) Updates `@tanstack/react-query` from 5.102.8 to 5.104.1 - [Release notes](https://github.com/TanStack/query/releases) - [Changelog](https://github.com/TanStack/query/blob/main/packages/react-query/CHANGELOG.md) - [Commits](https://github.com/TanStack/query/commits/@tanstack/react-query@5.104.1/packages/react-query) Updates `@uiw/codemirror-theme-vscode` from 4.25.11 to 4.25.12 - [Release notes](https://github.com/uiwjs/react-codemirror/releases) - [Commits](https://github.com/uiwjs/react-codemirror/compare/v4.25.11...v4.25.12) Updates `@uiw/react-codemirror` from 4.25.11 to 4.25.12 - [Release notes](https://github.com/uiwjs/react-codemirror/releases) - [Commits](https://github.com/uiwjs/react-codemirror/compare/v4.25.11...v4.25.12) Updates `@vanilla-extract/css` from 1.21.2 to 1.21.3 - [Release notes](https://github.com/vanilla-extract-css/vanilla-extract/releases) - [Changelog](https://github.com/vanilla-extract-css/vanilla-extract/blob/master/packages/css/CHANGELOG.md) - [Commits](https://github.com/vanilla-extract-css/vanilla-extract/commits/@vanilla-extract/css@1.21.3/packages/css) Updates `react-hook-form` from 7.87.0 to 7.89.0 - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.87.0...v7.89.0) Updates `react-is` from 19.2.8 to 19.3.0 - [Release notes](https://github.com/react/react/releases) - [Changelog](https://github.com/react/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/react/react/commits/v19.3.0/packages/react-is) Updates `@babel/core` from 8.0.1 to 8.0.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.0.7/packages/babel-core) Updates `@babel/preset-typescript` from 8.0.1 to 8.0.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.0.7/packages/babel-preset-typescript) Updates `@babel/runtime` from 8.0.0 to 8.0.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.0.7/packages/babel-runtime) Updates `@playwright/test` from 1.62.1 to 1.64.0 - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.62.1...v1.64.0) Updates `@types/node` from 26.4.0 to 26.6.4 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `oauth2-mock-server` from 9.1.0 to 9.2.0 - [Release notes](https://github.com/axa-group/oauth2-mock-server/releases) - [Changelog](https://github.com/axa-group/oauth2-mock-server/blob/master/CHANGELOG.md) - [Commits](https://github.com/axa-group/oauth2-mock-server/compare/v9.1.0...v9.2.0) Updates `otpauth` from 9.5.1 to 9.5.2 - [Release notes](https://github.com/hectorm/otpauth/releases) - [Commits](https://github.com/hectorm/otpauth/compare/v9.5.1...v9.5.2) Updates `rollup` from 4.63.1 to 4.64.2 - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v4.63.1...v4.64.2) Updates `vite` from 7.3.6 to 7.3.7 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v7.3.7/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v7.3.7/packages/vite) Updates `vite-plugin-dts` from 5.0.3 to 5.1.2 - [Release notes](https://github.com/qmhc/unplugin-dts/releases) - [Changelog](https://github.com/qmhc/unplugin-dts/blob/main/packages/vite-plugin-dts/CHANGELOG.md) - [Commits](https://github.com/qmhc/unplugin-dts/commits/vite-plugin-dts@5.1.2/packages/vite-plugin-dts) --- updated-dependencies: - dependency-name: "@codemirror/lang-liquid" dependency-version: 6.3.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@codemirror/language" dependency-version: 6.13.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: "@codemirror/state" dependency-version: 6.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@codemirror/view" dependency-version: 6.43.14 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@sentry/react" dependency-version: 11.5.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: dependencies - dependency-name: "@tabler/icons-react" dependency-version: 3.49.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: "@tanstack/react-query" dependency-version: 5.104.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: "@uiw/codemirror-theme-vscode" dependency-version: 4.25.12 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@uiw/react-codemirror" dependency-version: 4.25.12 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@vanilla-extract/css" dependency-version: 1.21.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: react-hook-form dependency-version: 7.89.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: react-is dependency-version: 19.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: "@babel/core" dependency-version: 8.0.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@babel/preset-typescript" dependency-version: 8.0.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@babel/runtime" dependency-version: 8.0.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@playwright/test" dependency-version: 1.64.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: "@types/node" dependency-version: 26.6.4 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: oauth2-mock-server dependency-version: 9.2.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: otpauth dependency-version: 9.5.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: rollup dependency-version: 4.64.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: vite dependency-version: 7.3.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: vite-plugin-dts dependency-version: 5.1.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * fix test assertations * fix pgready statement * lower playwright to 1.62.1 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matthias Mair <code@mjmair.com>
313 lines
11 KiB
YAML
313 lines
11 KiB
YAML
# Playwright testing for frontend code
|
|
# Runs the following tests:
|
|
# - Playwright tests in Firefox (against compiled frontend code)
|
|
# - Playwright tests in Chromium (coverage enabled, against vite frontend code)
|
|
# - Build frontend code and upload as artifact
|
|
|
|
name: Frontend
|
|
|
|
on:
|
|
push:
|
|
branches-ignore: ["l10*", "dependabot/**", "backport/**"]
|
|
pull_request:
|
|
branches-ignore: ["l10*"]
|
|
|
|
env:
|
|
python_version: 3.12
|
|
node_version: 24
|
|
plugin_creator_version: 1.20.1
|
|
# The OS version must be set per job
|
|
server_start_sleep: 60
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
INVENTREE_DB_ENGINE: postgresql
|
|
INVENTREE_DB_NAME: inventree
|
|
INVENTREE_DB_HOST: "127.0.0.1"
|
|
INVENTREE_DB_PORT: 5432
|
|
INVENTREE_DB_USER: inventree_user
|
|
INVENTREE_DB_PASSWORD: inventree_password
|
|
INVENTREE_DEBUG: true
|
|
INVENTREE_PLUGINS_ENABLED: false
|
|
INVENTREE_MEDIA_ROOT: /home/runner/work/InvenTree/test_inventree_media
|
|
INVENTREE_STATIC_ROOT: /home/runner/work/InvenTree/test_inventree_static
|
|
INVENTREE_BACKUP_DIR: /home/runner/work/InvenTree/test_inventree_backup
|
|
INVENTREE_SITE_URL: http://localhost:8000
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
paths-filter:
|
|
name: Filter
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
frontend: ${{ steps.filter.outputs.frontend }}
|
|
force: ${{ steps.force.outputs.force }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
frontend:
|
|
- 'src/frontend/**'
|
|
- name: Is CI being forced?
|
|
run: echo "force=true" >> $GITHUB_OUTPUT
|
|
id: force
|
|
if: |
|
|
contains(github.event.pull_request.labels.*.name, 'dependency') ||
|
|
contains(github.event.pull_request.labels.*.name, 'full-run')
|
|
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Environment Setup
|
|
uses: $/.github/actions/setup
|
|
with:
|
|
npm: true
|
|
- name: Install dependencies
|
|
run: cd src/frontend && yarn install --ignore-scripts
|
|
- name: Build frontend
|
|
run: cd src/frontend && yarn run compile && yarn run lib && yarn run build
|
|
- name: Write version file - SHA
|
|
run: cd src/backend/InvenTree/web/static/web/.vite && echo "$GITHUB_SHA" > sha.txt
|
|
- name: Zip frontend
|
|
run: |
|
|
cd src/backend/InvenTree/web/static
|
|
zip -r frontend-build.zip web/ web/.vite
|
|
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: frontend-build
|
|
path: src/backend/InvenTree/web/static/web
|
|
include-hidden-files: true
|
|
|
|
firefox:
|
|
name: Tests [Firefox ${{ matrix.shard }} / 2]
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 60
|
|
needs: ["build", "paths-filter"]
|
|
if: github.ref == 'refs/heads/master' || needs.paths-filter.outputs.frontend == 'true' || needs.paths-filter.outputs.force == 'true'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
shard: [1, 2]
|
|
services:
|
|
postgres:
|
|
image: postgres:17
|
|
env:
|
|
POSTGRES_DB: inventree
|
|
POSTGRES_USER: inventree_user
|
|
POSTGRES_PASSWORD: inventree_password
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U inventree_user -d inventree"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
permissions:
|
|
contents: read # Required for actions/checkout
|
|
id-token: write # Required for GitHub OIDC
|
|
env:
|
|
VITE_COVERAGE: false
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Environment Setup
|
|
uses: $/.github/actions/setup
|
|
with:
|
|
npm: true
|
|
install: true
|
|
update: true
|
|
apt-dependency: gettext postgresql-client libpq-dev
|
|
pip-dependency: psycopg
|
|
- name: Set up test data
|
|
run: |
|
|
invoke dev.setup-test -iv
|
|
invoke int.rebuild-thumbnails
|
|
- name: Install dependencies
|
|
run: invoke int.frontend-compile --extract
|
|
- name: Cache Playwright browsers
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
id: playwright-cache
|
|
with:
|
|
path: ~/.cache/ms-playwright
|
|
key: ${{ runner.os }}-playwright-${{ hashFiles('src/frontend/yarn.lock') }}
|
|
- name: Install Playwright browsers
|
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
|
run: cd src/frontend && npx --ignore-scripts playwright install --with-deps
|
|
- name: Install Playwright OS dependencies
|
|
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
|
run: cd src/frontend && npx --ignore-scripts playwright install-deps
|
|
- name: Install Sample Plugin
|
|
run: |
|
|
pip install -U inventree-plugin-creator==${{ env.plugin_creator_version }}
|
|
create-inventree-plugin --default
|
|
cd MyCustomPlugin && pip install -e . && cd frontend && npm install && npm run translate && npm run build
|
|
- name: Run Playwright tests
|
|
id: tests
|
|
run: |
|
|
cd src/frontend
|
|
cp ./tests/fixtures/playwright_custom_logo.png ../backend/InvenTree/InvenTree/static/img/playwright_custom_logo.png
|
|
cp ./tests/fixtures/playwright_custom_splash.png ../backend/InvenTree/InvenTree/static/img/playwright_custom_splash.png
|
|
invoke static
|
|
env INVENTREE_CUSTOM_SPLASH="img/playwright_custom_splash.png" INVENTREE_CUSTOM_LOGO="img/playwright_custom_logo.png" PLAYWRIGHT_BASE_URL=http://localhost:8000 npx --ignore-scripts playwright test --project=firefox --shard=${{ matrix.shard }}/2
|
|
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: ${{ !cancelled() && steps.tests.outcome == 'failure' }}
|
|
with:
|
|
name: playwright-report-firefox-${{ matrix.shard }}
|
|
path: src/frontend/playwright-report/
|
|
retention-days: 14
|
|
|
|
chromium:
|
|
name: Tests [Chromium ${{ matrix.shard }} / 4]
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 60
|
|
needs: ["build", "paths-filter"]
|
|
if: github.ref == 'refs/heads/master' || needs.paths-filter.outputs.frontend == 'true' || needs.paths-filter.outputs.force == 'true'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
shard: [1, 2, 3, 4]
|
|
services:
|
|
postgres:
|
|
image: postgres:17
|
|
env:
|
|
POSTGRES_DB: inventree
|
|
POSTGRES_USER: inventree_user
|
|
POSTGRES_PASSWORD: inventree_password
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U inventree_user -d inventree"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
permissions:
|
|
contents: read # Required for actions/checkout
|
|
id-token: write # Required for GitHub OIDC
|
|
|
|
env:
|
|
COVERAGE: true
|
|
VITE_COVERAGE: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Environment Setup
|
|
uses: $/.github/actions/setup
|
|
with:
|
|
npm: true
|
|
install: true
|
|
update: true
|
|
apt-dependency: gettext postgresql-client libpq-dev
|
|
pip-dependency: psycopg
|
|
- name: Set up test data
|
|
run: |
|
|
invoke dev.setup-test -iv
|
|
invoke int.rebuild-thumbnails
|
|
- name: Install dependencies
|
|
run: invoke int.frontend-compile --extract
|
|
- name: Cache Playwright browsers
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
id: playwright-cache
|
|
with:
|
|
path: ~/.cache/ms-playwright
|
|
key: ${{ runner.os }}-playwright-${{ hashFiles('src/frontend/yarn.lock') }}
|
|
- name: Install Playwright browsers
|
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
|
run: cd src/frontend && npx --ignore-scripts playwright install --with-deps
|
|
- name: Install Playwright OS dependencies
|
|
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
|
run: cd src/frontend && npx --ignore-scripts playwright install-deps
|
|
- name: Install Sample Plugin
|
|
run: |
|
|
pip install -U inventree-plugin-creator==${{ env.plugin_creator_version }}
|
|
create-inventree-plugin --default
|
|
cd MyCustomPlugin && pip install -e . && cd frontend && npm install && npm run translate && npm run build
|
|
- name: Playwright [${{ matrix.shard }} / 4]
|
|
id: tests
|
|
run: |
|
|
cd src/frontend
|
|
npx --ignore-scripts nyc playwright test --project=chromium --shard=${{ matrix.shard }}/4
|
|
- name: Playwright Report [${{ matrix.shard }} / 4]
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: ${{ !cancelled() && steps.tests.outcome == 'failure' }}
|
|
with:
|
|
name: playwright-report-chromium-${{ matrix.shard }}
|
|
path: src/frontend/playwright-report/
|
|
if-no-files-found: error
|
|
retention-days: 7
|
|
- name: Upload Coverage Artifact [${{ matrix.shard }} / 4]
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
id: coverage-upload
|
|
if: ${{ !cancelled() && steps.tests.outcome != 'failure' }}
|
|
with:
|
|
name: coverage-${{ matrix.shard }}
|
|
path: src/frontend/.nyc_output/
|
|
if-no-files-found: error
|
|
include-hidden-files: true
|
|
retention-days: 1
|
|
|
|
# Recombine the coverage reports from the 4 shards, and upload to Codecov
|
|
coverage:
|
|
name: Merge coverage reports and upload to Codecov
|
|
runs-on: ubuntu-latest
|
|
needs: chromium
|
|
timeout-minutes: 30
|
|
if: always()
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Environment Setup
|
|
uses: $/.github/actions/setup
|
|
with:
|
|
npm: true
|
|
install: false
|
|
update: false
|
|
|
|
- name: Download Coverage Artifacts
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
pattern: coverage-*
|
|
path: all-coverage/
|
|
merge-multiple: true
|
|
|
|
- name: Merge Coverage Reports
|
|
run: |
|
|
mkdir -p .nyc_output
|
|
cp all-coverage/*.json .nyc_output/ 2>/dev/null || true
|
|
npx --ignore-scripts nyc merge .nyc_output merged-coverage.json
|
|
npx --ignore-scripts nyc report \
|
|
--tempdir .nyc_output \
|
|
--reporter=lcov \
|
|
--reporter=text-summary \
|
|
--report-dir ./coverage \
|
|
|
|
- name: Upload coverage reports to Codecov
|
|
if: ${{ !cancelled() && github.ref == 'refs/heads/master' }}
|
|
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
slug: inventree/InvenTree
|
|
flags: web
|
|
files: ./coverage/lcov.info
|