fix(tooling): migrate to use github-actions #28
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: Pull Request | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize, labeled, unlabeled] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| validate: | |
| name: Validate Pull Request | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Ensure PR has validated label | |
| if: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| HAS_VALIDATED_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'validated') }} | |
| run: | | |
| if [ "${HAS_VALIDATED_LABEL}" != "true" ]; then | |
| echo "Missing required 'validated' label on pull request." | |
| exit 1 | |
| fi | |
| install: | |
| name: Install Dependencies | |
| runs-on: ubuntu-latest | |
| needs: validate | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| - name: Save node_modules cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} | |
| tests: | |
| name: Unit Tests And Linting | |
| runs-on: ubuntu-latest | |
| needs: install | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| - name: Restore node_modules cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} | |
| fail-on-cache-miss: true | |
| - name: Run eslint | |
| run: npm run eslint | |
| - name: Run Jest suites | |
| run: npm run jest -- --ci -i | |
| - name: Upload lint and jest reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: junit-unit-lint | |
| path: reports/junit | |
| if-no-files-found: ignore | |
| build_for_tests: | |
| name: Build Artifacts For Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: install | |
| env: | |
| FEDERATION: "true" | |
| NODE_ENV: test | |
| WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL: https://conversation-intb.ciscospark.com/conversation/api/v1 | |
| WEBEX_CONVERSATION_DEFAULT_CLUSTER: urn:TEAM:us-east-1_int13:identityLookup | |
| HYDRA_SERVICE_URL: https://apialpha.ciscospark.com/v1/ | |
| IDBROKER_BASE_URL: https://idbrokerbts.webex.com | |
| U2C_SERVICE_URL: https://u2c-intb.ciscospark.com/u2c/api/v1 | |
| WDM_SERVICE_URL: https://wdm-intb.ciscospark.com/wdm/api/v1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| - name: Restore node_modules cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} | |
| fail-on-cache-miss: true | |
| - name: Build journey test static files | |
| run: npm run build -- journey dist-test | |
| - name: Upload dist-test artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-test | |
| path: dist-test | |
| journey_tests_chrome: | |
| name: Integration Tests Chrome | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| timeout-minutes: 45 | |
| needs: build_for_tests | |
| env: | |
| SAUCE: "true" | |
| STATIC_SERVER_PATH: dist-test | |
| WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL: https://conversation-intb.ciscospark.com/conversation/api/v1 | |
| WEBEX_CONVERSATION_DEFAULT_CLUSTER: urn:TEAM:us-east-1_int13:identityLookup | |
| HYDRA_SERVICE_URL: https://apialpha.ciscospark.com/v1/ | |
| IDBROKER_BASE_URL: https://idbrokerbts.webex.com | |
| U2C_SERVICE_URL: https://u2c-intb.ciscospark.com/u2c/api/v1 | |
| WDM_SERVICE_URL: https://wdm-intb.ciscospark.com/wdm/api/v1 | |
| WEBEX_APPID_ORGID: ${{ secrets.WEBEX_APPID_ORGID }} | |
| WEBEX_APPID_SECRET: ${{ secrets.WEBEX_APPID_SECRET }} | |
| WEBEX_CLIENT_ID: ${{ secrets.WEBEX_CLIENT_ID }} | |
| WEBEX_CLIENT_SECRET: ${{ secrets.WEBEX_CLIENT_SECRET }} | |
| SKIP_FLAKY_TESTS: ${{ secrets.SKIP_FLAKY_TESTS }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| - name: Restore node_modules cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} | |
| fail-on-cache-miss: true | |
| - name: Download dist-test artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-test | |
| path: dist-test | |
| - name: Run integration tests in Chrome | |
| timeout-minutes: 5 | |
| env: | |
| BUILD_NUMBER: github-actions-${{ github.run_number }} | |
| BROWSER: chrome | |
| run: npm run test:integration | |
| - name: Upload Chrome test reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wdio-chrome | |
| path: | | |
| reports/junit/wdio | |
| reports/browser | |
| if-no-files-found: ignore | |
| journey_tests_firefox: | |
| name: Integration Tests Firefox | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| timeout-minutes: 45 | |
| needs: build_for_tests | |
| env: | |
| SAUCE: "true" | |
| STATIC_SERVER_PATH: dist-test | |
| WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL: https://conversation-intb.ciscospark.com/conversation/api/v1 | |
| WEBEX_CONVERSATION_DEFAULT_CLUSTER: urn:TEAM:us-east-1_int13:identityLookup | |
| HYDRA_SERVICE_URL: https://apialpha.ciscospark.com/v1/ | |
| IDBROKER_BASE_URL: https://idbrokerbts.webex.com | |
| U2C_SERVICE_URL: https://u2c-intb.ciscospark.com/u2c/api/v1 | |
| WDM_SERVICE_URL: https://wdm-intb.ciscospark.com/wdm/api/v1 | |
| WEBEX_APPID_ORGID: ${{ secrets.WEBEX_APPID_ORGID }} | |
| WEBEX_APPID_SECRET: ${{ secrets.WEBEX_APPID_SECRET }} | |
| WEBEX_CLIENT_ID: ${{ secrets.WEBEX_CLIENT_ID }} | |
| WEBEX_CLIENT_SECRET: ${{ secrets.WEBEX_CLIENT_SECRET }} | |
| SKIP_FLAKY_TESTS: ${{ secrets.SKIP_FLAKY_TESTS }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| - name: Restore node_modules cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }} | |
| fail-on-cache-miss: true | |
| - name: Download dist-test artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-test | |
| path: dist-test | |
| - name: Run integration tests in Firefox | |
| timeout-minutes: 5 | |
| env: | |
| BUILD_NUMBER: github-actions-${{ github.run_number }} | |
| BROWSER: firefox | |
| run: npm run test:integration | |
| - name: Upload Firefox test reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wdio-firefox | |
| path: | | |
| reports/junit/wdio | |
| reports/browser | |
| if-no-files-found: ignore |