Update npm scripts for unit test directory configs. #1139
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: Alloy Reactor Extension | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | |
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | |
SAUCE_JOB: "Alloy Reactor Extension" | |
SAUCE_CAPABILITIES_OVERRIDES_PATH: "sauceLabsCapabilities.json" | |
EDGE_E2E_PRIVATE_KEY_CONTENTS: ${{ secrets.EDGE_E2E_PRIVATE_KEY_CONTENTS }} | |
EDGE_E2E_CLIENT_SECRET: ${{ secrets.EDGE_E2E_CLIENT_SECRET }} | |
REACTOR_IO_INTEGRATION_PRIVATE_KEY_CONTENTS: ${{ secrets.REACTOR_IO_INTEGRATION_PRIVATE_KEY_CONTENTS }} | |
REACTOR_IO_INTEGRATION_CLIENT_SECRET: ${{ secrets.REACTOR_IO_INTEGRATION_CLIENT_SECRET }} | |
jobs: | |
unit-test: | |
name: "Unit Test" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- uses: saucelabs/sauce-connect-action@v2 | |
with: | |
username: ${{ secrets.SAUCE_USERNAME }} | |
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }} | |
tunnelIdentifier: github-${{ github.run_id }} | |
retryTimeout: 300 | |
verbose: true | |
- name: Run Unit Test | |
run: npx karma start karma.saucelabs.conf.js --single-run | |
env: | |
BUILD_NUMBER: ${{ github.run_number }} | |
BUILD_ID: ${{ github.run_id }} | |
JOB_NUMBER: ${{ github.job }} | |
functional-test: | |
name: "Functional Test" | |
needs: unit-test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
browser: [chrome, firefox, safari] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js from Sauce Labs config | |
uses: actions/setup-node@v4 | |
- uses: actions/cache@v4 | |
id: npm-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}-${{ secrets.NPM_CACHE_VERSION }} | |
- name: Install node packages | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Retrieve Token | |
run: npm run token | |
- name: Run Functional Test - ${{ matrix.browser }} | |
uses: saucelabs/[email protected] | |
with: | |
config-file: .sauce/config.${{ matrix.browser }}.yml | |
sauceignore: .sauceignore | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | |
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | |
EDGE_E2E_PRIVATE_KEY_CONTENTS: ${{ secrets.EDGE_E2E_PRIVATE_KEY_CONTENTS }} | |
EDGE_E2E_CLIENT_SECRET: ${{ secrets.EDGE_E2E_CLIENT_SECRET }} | |
REACTOR_IO_INTEGRATION_PRIVATE_KEY_CONTENTS: ${{ secrets.REACTOR_IO_INTEGRATION_PRIVATE_KEY_CONTENTS }} | |
REACTOR_IO_INTEGRATION_CLIENT_SECRET: ${{ secrets.REACTOR_IO_INTEGRATION_CLIENT_SECRET }} |