Add e2e and unit tests for Key Manager Configuration Constraints feature #1784
Workflow file for this run
This file contains hidden or 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: API Manager UI Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-product: | |
| runs-on: ubuntu-latest | |
| env: | |
| APIM_VERSION: 4.6.0-SNAPSHOT | |
| APIM_DIR: wso2am-4.6.0-SNAPSHOT | |
| APIM_DOWNLOAD_URL: https://wso2.org/jenkins/job/products/job/product_apim/job/product-apim/lastStableBuild/org.wso2.am$wso2am/artifact/org.wso2.am/wso2am/4.6.0-SNAPSHOT/wso2am-4.6.0-SNAPSHOT.zip | |
| steps: | |
| - name: Run hostname | |
| run: hostname | |
| - name: Fix host entry | |
| run: sudo echo "127.0.0.1 $(hostname)" | sudo tee -a /etc/hosts | |
| - name: Show hosts | |
| run: cat /etc/hosts | |
| - name: Checkout master | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '10' | |
| path: apim-apps | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 11 | |
| distribution: 'temurin' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Cache maven packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2 | |
| restore-keys: ${{ runner.os }}-m2 | |
| - name: Build apim-apps with tests | |
| run: mvn clean install --file apim-apps/pom.xml | |
| - name: Get apim.apps.version | |
| run: mvn help:evaluate -Dexpression=project.version -q --file apim-apps/pom.xml -DforceStdout > ../APIM_APPS_VERSION_FILE | |
| - name: Print apim.apps.version | |
| run: echo $(cat ../APIM_APPS_VERSION_FILE) | |
| - name: Download latest API Manager pack | |
| run: wget '${{ env.APIM_DOWNLOAD_URL }}' | |
| - name: Prepare APIM pack with built portals and configurations | |
| run: | | |
| unzip ${{ env.APIM_DIR }}.zip | |
| for portal in publisher devportal admin; do | |
| echo "Replacing $portal portal..." | |
| rm -rf "${{ env.APIM_DIR }}/repository/deployment/server/webapps/$portal" | |
| cp -r "apim-apps/portals/$portal/target/$portal.war" "${{ env.APIM_DIR }}/repository/deployment/server/webapps/" | |
| done | |
| echo "Appending devportal config to deployment.toml" | |
| printf "\n[apim.devportal]\nenable_application_sharing = true\napplication_sharing_type = \"default\"\n" >> ${{ env.APIM_DIR }}/repository/conf/deployment.toml | |
| - name: Start APIM server | |
| run: | | |
| sh ${{ env.APIM_DIR }}/bin/api-manager.sh start | |
| sleep 5m # sleep for 5 min to start the server | |
| nc -zv localhost 9443 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Cypress run | |
| uses: cypress-io/github-action@v4 | |
| with: | |
| record: false | |
| working-directory: 'apim-apps/tests' | |
| spec: '**/*.spec.js' | |
| - name: Upload Screenshots | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: cypress-screenshots | |
| path: apim-apps/tests/cypress/screenshots | |
| - name: Upload Videos | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: cypress-videos | |
| path: apim-apps/tests/cypress/videos | |
| - name: Upload Logs | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: server-logs | |
| path: ${{ env.APIM_DIR }}/repository/logs |