|
42 | 42 | with: |
43 | 43 | name: time-planning-container |
44 | 44 | path: time-planning-container.tar |
| 45 | + angular-unit-test: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + continue-on-error: true |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v3 |
| 50 | + with: |
| 51 | + path: eform-angular-timeplanning-plugin |
| 52 | + - name: Extract branch name |
| 53 | + id: extract_branch |
| 54 | + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" |
| 55 | + - name: 'Preparing Frontend checkout' |
| 56 | + uses: actions/checkout@v3 |
| 57 | + with: |
| 58 | + fetch-depth: 0 |
| 59 | + repository: microting/eform-angular-frontend |
| 60 | + ref: ${{ steps.extract_branch.outputs.branch }} |
| 61 | + path: eform-angular-frontend |
| 62 | + - name: Use Node.js |
| 63 | + uses: actions/setup-node@v3 |
| 64 | + with: |
| 65 | + node-version: 20 |
| 66 | + - name: Copy dependencies |
| 67 | + run: | |
| 68 | + cp -av eform-angular-timeplanning-plugin/eform-client/src/app/plugins/modules/time-planning-pn eform-angular-frontend/eform-client/src/app/plugins/modules/time-planning-pn |
| 69 | + cd eform-angular-frontend/eform-client && ../../eform-angular-timeplanning-plugin/testinginstallpn.sh |
| 70 | + - name: yarn install |
| 71 | + run: cd eform-angular-frontend/eform-client && yarn install |
| 72 | + - name: Run Angular unit tests |
| 73 | + run: | |
| 74 | + cd eform-angular-frontend/eform-client |
| 75 | + # Check if Jest is configured |
| 76 | + if [ ! -f "jest.config.js" ] && [ ! -f "jest.config.ts" ]; then |
| 77 | + echo "⚠️ Jest is not configured in the frontend repository." |
| 78 | + echo "Unit tests require Jest to be configured. Skipping unit tests." |
| 79 | + echo "" |
| 80 | + echo "To enable unit tests, ensure Jest is configured in the frontend repository." |
| 81 | + exit 0 |
| 82 | + fi |
| 83 | + |
| 84 | + # Run Jest tests for time-planning-pn plugin |
| 85 | + echo "Running Jest tests for time-planning-pn plugin..." |
| 86 | + npm test:unit -- --testPathPattern=time-planning-pn --coverage --collectCoverageFrom='src/app/plugins/modules/time-planning-pn/**/*.ts' --coveragePathIgnorePatterns='\.spec\.ts$' |
45 | 87 | pn-test: |
46 | 88 | needs: build |
47 | 89 | runs-on: ubuntu-latest |
|
0 commit comments