diff --git a/src/Umbraco.Web.UI.Client/.github/workflows/build.yml b/src/Umbraco.Web.UI.Client/.github/workflows/build.yml new file mode 100644 index 0000000000..97a076af49 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/.github/workflows/build.yml @@ -0,0 +1,40 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Build + +on: + push: + branches: + - main + - release/* + pull_request: + branches: + - main + - release/* + + # Allows GitHub to use this workflow to validate the merge queue + merge_group: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + NODE_OPTIONS: --max_old_space_size=16384 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: ./package-lock.json + - run: npm ci --no-audit --no-fund --prefer-offline + - run: npm run lint:errors + - run: npm run build:for:npm + - run: npm run generate:jsonschema:dist diff --git a/src/Umbraco.Web.UI.Client/.github/workflows/build_test.yml b/src/Umbraco.Web.UI.Client/.github/workflows/test.yml similarity index 60% rename from src/Umbraco.Web.UI.Client/.github/workflows/build_test.yml rename to src/Umbraco.Web.UI.Client/.github/workflows/test.yml index 6bccda7c83..199d177548 100644 --- a/src/Umbraco.Web.UI.Client/.github/workflows/build_test.yml +++ b/src/Umbraco.Web.UI.Client/.github/workflows/test.yml @@ -1,7 +1,7 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Build and test +name: Test on: push: @@ -26,21 +26,15 @@ jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20] - steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} - cache: 'npm' + node-version-file: .nvmrc + cache: npm + cache-dependency-path: ./package-lock.json - run: npm ci --no-audit --no-fund --prefer-offline - - run: npm run lint:errors - - run: npm run build - - run: npm run generate:jsonschema:dist - run: npx playwright install --with-deps - run: npm test - name: Upload Code Coverage reports @@ -50,13 +44,3 @@ jobs: name: code-coverage path: coverage/ retention-days: 30 - # Commented out since it is outdated and is quite spammy - # - name: Report code coverage - # uses: zgosalvez/github-actions-report-lcov@v2 - # if: always() - # continue-on-error: true - # with: - # coverage-files: coverage/lcov.info - # artifact-name: code-coverage-report - # github-token: ${{ secrets.GITHUB_TOKEN }} - # working-directory: ./