fixes variable resolution #2865
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
on: [pull_request] | |
env: | |
TOKEN_FLOW_APP_URL: ${{ secrets.TOKEN_FLOW_APP_URL }} | |
jobs: | |
# install dependencies and store artifact | |
package: | |
name: Create Package | |
runs-on: ubuntu-22.04 | |
steps: | |
# 1: Setup node | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
# 2: Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Cache node modules | |
id: cache-nodemodules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# caching node_modules | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ env.cache-name }}- | |
# 3: Install dependencies | |
- name: Install dependencies | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: npm ci | |
# 5: Build package | |
- name: Build Package | |
run: npm run build | |
# 6: Store artifact | |
- name: Store Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: package | |
path: | | |
dist | |
manifest.json | |
# install dependencies and run test command | |
test: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
# 1: Setup node | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
# 2: Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
# 3: Install dependencies. | |
- name: Cache node modules | |
id: cache-nodemodules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# caching node_modules | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ env.cache-name }}- | |
# This is very unlikely to happen, but we include it anyway in case some cache flushing happens | |
- name: Install dependencies | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: npm ci | |
# 4: Run tests | |
- name: Run test command | |
run: npm run test | |
coverage: | |
name: Test coverage | |
continue-on-error: true | |
runs-on: ubuntu-22.04 | |
steps: | |
# 1: Setup node | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
# 2: Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
# 3: Install dependencies. | |
- name: Cache node modules | |
id: cache-nodemodules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# caching node_modules | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ env.cache-name }}- | |
# This is very unlikely to happen, but we include it anyway in case some cache flushing happens | |
- name: Install dependencies | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: npm ci | |
# 4: Run test coverage report | |
- name: Run test coverage report | |
id: testCoverage | |
uses: anuraag016/Jest-Coverage-Diff@master | |
with: | |
fullCoverageDiff: false | |
runCommand: 'LAUNCHDARKLY_FLAGS=tokenThemes,gitBranchSelector,multiFileSync,tokenFlowButton npx jest --collectCoverageFrom=''["src/**/*.{js,jsx,ts,tsx}"]'' --coverage --collectCoverage=true --coverageDirectory=''./'' --coverageReporters=''json-summary'' --forceExit --detectOpenHandles ' | |
afterSwitchCommand: npm ci | |
useSameComment: true | |
test-transform: | |
name: Transformer Tests | |
runs-on: ubuntu-22.04 | |
steps: | |
# 1: Setup node | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
# 2: Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
# 3: Install dependencies. | |
- name: Cache node modules | |
id: cache-nodemodules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# caching node_modules | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ env.cache-name }}- | |
# This is very unlikely to happen, but we include it anyway in case some cache flushing happens | |
- name: Install dependencies | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: npm ci | |
# 4: Build package | |
- name: build:transform | |
run: npm run build-transform | |
# 5: Install dependencies | |
- name: Install dependencies - transformer | |
run: cd token-transformer && npm ci | |
# 6: Run tests | |
- name: Run test command | |
run: cd token-transformer && npm run test | |
cypress-run: | |
name: Cypress | |
runs-on: ubuntu-22.04 | |
steps: | |
# 1: Checkout repository | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# 2: Install NPM dependencies, cache them correctly | |
# and run all Cypress tests | |
- name: Cypress run | |
uses: cypress-io/github-action@v2 | |
with: | |
build: npm run build:cy | |
start: npm run serve |