Skip to content

Update CONTRIBUTING.md #942

Update CONTRIBUTING.md

Update CONTRIBUTING.md #942

Workflow file for this run

#
# Copyright the original author or authors from the JHipster project.
#
# This file is part of the JHipster project, see https://www.jhipster.tech/
# for more information.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: React
concurrency:
# Group PRs by head_ref, push to main branch by commit id, and others branch by ref.
group: ${{ github.workflow }}-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
types: [closed, opened, synchronize, reopened]
branches:
- '*'
permissions:
contents: read
env:
FORCE_COLOR: 2
jobs:
build-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- id: build
run: |
npm install
./cli/cli.cjs github-build-matrix react
samples:
name: ${{ matrix.job-name || matrix.sample }}
runs-on: ${{ matrix.os }}
needs: build-matrix
defaults:
run:
working-directory: ${{ github.workspace }}/app
timeout-minutes: 30
strategy:
fail-fast: false
matrix: ${{fromJson(needs.build-matrix.outputs.matrix)}}
steps:
#----------------------------------------------------------------------
# Install all tools and check configuration
#----------------------------------------------------------------------
- uses: actions/checkout@v4
with:
path: jhipster-kotlin
fetch-depth: 2
- uses: jhipster/actions/setup-runner@v0
with:
java-version: ${{ matrix.java-version }}
node-version: ${{ matrix.node-version }}
maven-cache: true
gradle-cache: true
binary-dir: ${{ github.workspace }}/jhipster-kotlin/cli
- run: npm install
working-directory: ${{ github.workspace }}/jhipster-kotlin
- run: |
mkdir -p ~/.gradle
echo "org.gradle.warning.mode=all" >> ~/.gradle/gradle.properties
- run: cli.cjs generate-sample ${{ matrix.sample }} --skip-jhipster-dependencies --skip-install --skip-ktlint-format ${{ matrix.extra-args }} ${{ matrix.new-extra-args }}
- run: cli.cjs info
#----------------------------------------------------------------------
# Detect changes against base commit
#----------------------------------------------------------------------
- uses: jhipster/actions/compare-sample@v0
id: compare
if: >-
github.event.pull_request &&
!contains(github.event.pull_request.labels.*.name, 'pr: disable-compare')
with:
generator-path: jhipster-kotlin
cmd: cli.cjs generate-sample --skip-jhipster-dependencies --skip-install --skip-ktlint-format ${{ matrix.extra-args }}
env:
JHI_APP: ${{ matrix.app-sample || 'jdl' }}
JHI_ENTITY: ${{ matrix.entity || 'none' }}
JHI_JDL_ENTITY: ${{ matrix.jdl-entity || '' }}
JHI_JDL_APP: ${{ matrix.jdl-samples || '' }}
#----------------------------------------------------------------------
# Launch tests
#----------------------------------------------------------------------
- run: npm run ci:backend:test
id: backend
if: steps.compare.outputs.equals != 'true' && matrix.skip-backend-tests != 1
continue-on-error: ${{matrix.continue-on-backend-tests-error || false}}
timeout-minutes: 20
- run: ${{ (matrix.workspaces == 'true' && 'npm') || './npmw' }} install
if: steps.compare.outputs.equals != 'true'
timeout-minutes: 7
- run: npm run ci:e2e:package
if: steps.compare.outputs.equals != 'true'
timeout-minutes: 7
- run: npm run ci:e2e:prepare
if: steps.compare.outputs.equals != 'true'
timeout-minutes: 5
- run: npm run preci:e2e:server:start --if-present
- run: npm run ci:e2e:run --if-present
id: e2e
if: steps.compare.outputs.equals != 'true'
timeout-minutes: 20
# - name: 'TESTS: frontend'
# if: steps.compare.outputs.equals != 'true' && matrix.skip-frontend-tests != 1
# run: npm run ci:frontend:test
# timeout-minutes: 8
- name: 'BACKEND: Store failure logs'
uses: actions/upload-artifact@v4
if: always() && steps.backend.outcome == 'failure'
with:
name: log-${{ matrix.name }}
path: ${{ steps.setup.outputs.application-path }}/**/reports/ktlint/**
- name: 'E2E: Store failure screenshots'
uses: actions/upload-artifact@v4
if: always() && steps.e2e.outcome == 'failure'
with:
name: screenshots-${{ matrix.name }}
path: ${{ steps.setup.outputs.application-path }}/**/cypress/screenshots
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
check-react:
permissions:
contents: none
runs-on: ubuntu-latest
needs: [samples]
if: always()
steps:
- run: |
echo '${{ toJSON(needs) }}'
if [ 'skipped' == '${{ needs.samples.result }}' ] || [ 'success' == '${{ needs.samples.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then
exit 0
fi
exit 1