NXP-32573 : unit tests & refactoring #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Functional tests | |
on: | |
pull_request: | |
branches: | |
- dev | |
workflow_call: | |
inputs: | |
branch: | |
description: 'The current branch' | |
default: dev | |
type: string | |
required: false | |
secrets: | |
NPM_PACKAGES_TOKEN: | |
description: 'NPM_PACKAGES_TOKEN' | |
required: true | |
PACKAGES_AUTH_USER: | |
description: 'PACKAGES_AUTH_USER' | |
required: true | |
PACKAGES_AUTH_TOKEN: | |
description: 'PACKAGES_AUTH_TOKEN' | |
required: true | |
env: | |
REFERENCE_BRANCH: dev | |
NPM_REPOSITORY: https://packages.nuxeo.com/repository/npm-public/ | |
BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'dev' }} | |
jobs: | |
ftests: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ env.BRANCH_NAME }} | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: ${{ env.NPM_REPOSITORY }} | |
scope: '@nuxeo' | |
node-version: 18 | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Install Admin Console UI | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} | |
run: | | |
npm install | |
pushd packages/nuxeo-admin-console-ui-ftest | |
npm install | |
popd | |
pushd packages/nuxeo-designer-catalog | |
npm install | |
popd | |
- name: Add .npmrc | |
run: | | |
pushd /tmp/_temp/ | |
rm .npmrc | |
touch .npmrc | |
popd | |
echo ' | |
packages.nuxeo.com/repository/npm-public/:_auth=${NODE_AUTH_TOKEN} | |
@nuxeo:registry=https://packages.nuxeo.com/repository/npm-public/ | |
always-auth=true | |
' >> /tmp/_temp/.npmrc | |
- name: 'Update settings.xml with server configuration' | |
run: | | |
echo '<settings> | |
<servers> | |
<server> | |
<id>maven-internal</id> | |
<username>${{ secrets.PACKAGES_AUTH_USER }}</username> | |
<password>${{ secrets.PACKAGES_AUTH_TOKEN }}</password> | |
</server> | |
</servers> | |
</settings>' > ~/.m2/settings.xml | |
- name: Functional tests | |
env: | |
RUN_ALL: false | |
BAIL: 0 | |
run: mvn -ntp install -Pftest -DskipInstall | |
- name: Archive cucumber reports | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cucumber-reports | |
path: ftest/target/cucumber-reports/ | |
- name: Archive screenshots | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: screenshots | |
path: ftest/target/screenshots/ | |
- name: Archive logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: logs | |
path: | | |
**/log/*.log | |
**/nxserver/config/distribution.properties | |
- name: Archive packages | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: packages | |
path: | | |
plugin/admin-console-ui/marketplace/target/nuxeo-admin-console-ui-marketplace-*.zip | |
plugin/itests/marketplace/target/nuxeo-web-ui-marketplace-itests-*.zip |