Gh actions vitest unit test update. #1140
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: | |
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: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run Unit Tests | |
run: npm run test:unit | |
- name: Upload Coverage Reports | |
if: always() | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage/lcov.info | |
fail_ci_if_error: true | |
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 }} |