@@ -12,9 +12,124 @@ jobs:
1212 name : Scan
1313 runs-on : ubuntu-latest
1414 steps :
15+ # #######################################
16+ # Checkout and Build vue-form-elements
17+ # #######################################
1518 - uses : actions/checkout@v2
1619 with :
1720 fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
21+ - name : Setup node env 🏗
22+ uses : actions/setup-node@master
23+ with :
24+ node-version : 20
25+ check-latest : true
26+ cache : ' npm'
27+
28+ - name : Install vfe dependencies
29+ run : npm ci && npm run build-bundle
30+
31+ - name : Link vue-form-elements
32+ run : npm link
33+
34+ # #######################################
35+ # Checkout and Build screen-builder
36+ # #######################################
37+ - name : Get screen-builder-version from PR body
38+ uses : actions-ecosystem/action-regex-match@v2
39+ id : screen-builder-version
40+ with :
41+ text : ${{ github.event.pull_request.body }}
42+ regex : ' ci:screen-builder:([^\s]+)'
43+
44+ - name : Set env variable SCREEN_BUILDER_BRANCH (default=develop)
45+ run : |
46+ export SCREEN_BUILDER_BRANCH='develop'
47+ if [[ ${{ contains(github.event.pull_request.body, 'ci:next') }} ]]; then
48+ export SCREEN_BUILDER_BRANCH=next
49+ fi
50+ if [[ ${{ steps.screen-builder-version.outputs.match != '' }} ]]; then
51+ export SCREEN_BUILDER_BRANCH=${{ steps.screen-builder-version.outputs.group1 }}
52+ fi
53+ echo "SCREEN_BUILDER_BRANCH=${SCREEN_BUILDER_BRANCH}" >> $GITHUB_ENV
54+
55+ - name : Checkout screen-builder
56+ uses : actions/checkout@v4
57+ with :
58+ repository : ProcessMaker/screen-builder
59+ path : screen-builder
60+ ref : ${{ env.SCREEN_BUILDER_BRANCH }}
61+
62+ - name : Link vue-form-elements
63+ run : npm link @processmaker/vue-form-elements
64+
65+ - name : Install screen-builder dependencies
66+ working-directory : screen-builder
67+ run : npm ci && npm run build-bundle
68+
69+ # #######################################
70+ # Checkout and Build screen-builder
71+ # #######################################
72+ - name : Cypress run
73+ uses : cypress-io/github-action@v6
74+ with :
75+ working-directory : screen-builder
76+ browser : chrome
77+ install : false
78+ start : npm run dev
79+ wait-on : ' http://localhost:5173/'
80+ config-file : cypress.config.js
81+ spec : " tests/e2e/**/*"
82+ record : true
83+ parallel : true
84+ group : ' CI - Chrome'
85+ env :
86+ # For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
87+ # in GitHub repo → Settings → Secrets → Actions
88+ CYPRESS_RECORD_KEY : ${{ secrets.CYPRESS_RECORD_KEY }}
89+ # Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
90+ GITHUB_TOKEN : ${{ secrets.GIT_TOKEN }}
91+ COMMIT_INFO_MESSAGE : ${{ github.event.pull_request.title }}
92+ # re-enable PR comment bot
93+ COMMIT_INFO_SHA : ${{github.event.pull_request.head.sha}}
94+ - name : Upload Cypress Screenshots
95+ uses : actions/upload-artifact@v4
96+ # Only capture images on failure
97+ if : failure()
98+ with :
99+ name : cypress-screenshots
100+ path : screen-builder/tests/e2e/screenshots
101+
102+ - name : Upload Cypress Videos
103+ uses : actions/upload-artifact@v4
104+ # Only capture videos on failure
105+ if : failure()
106+ with :
107+ name : cypress-videos
108+ path : screen-builder/tests/e2e/videos
109+ - run : ls -l .
110+ - run : ls -R coverage .nyc_output
111+
112+ - name : Prepare coverage
113+ working-directory : screen-builder
114+ run : cp .nyc_output/out.json coverage/coverage-${{ matrix.containers }}.json
115+ - name : Archive code coverage
116+ uses : actions/upload-artifact@v4
117+ with :
118+ name : coverage-${{ matrix.containers }}
119+ path : ./screen-builder/coverage/coverage-${{ matrix.containers }}.json
120+
121+ - name : Create coverage report
122+ working-directory : screen-builder
123+ run : npx nyc report --reporter html --reporter text --reporter json-summary --reporter lcov --report-dir coverage
124+ - name : Store Artifacts
125+ uses : actions/upload-artifact@v4
126+ with :
127+ name : code-coverage-report
128+ path : |
129+ coverage
130+ .nyc_output
131+ reports
132+
18133 - uses : sonarsource/sonarqube-scan-action@master
19134 env :
20135 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
0 commit comments