name: Javascript on: push: branches: [ master ] pull_request: branches: [ master ] jobs: lint_markdown_files: uses: optimizely/javascript-sdk/.github/workflows/lint_markdown.yml@master lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Node uses: actions/setup-node@v3 with: node-version: 16 cache-dependency-path: ./package-lock.json cache: 'npm' - name: Run linting working-directory: . run: | npm install npm run lint typescript_test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Node uses: actions/setup-node@v3 with: node-version: 20 cache-dependency-path: ./package-lock.json cache: 'npm' - name: Run TypeScript example working-directory: . run: | npm install npm run test-typescript integration_tests: uses: optimizely/javascript-sdk/.github/workflows/integration_test.yml@master secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} fullstack_production_suite: uses: optimizely/javascript-sdk/.github/workflows/integration_test.yml@master with: FULLSTACK_TEST_REPO: ProdTesting secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} browser_tests: runs-on: ubuntu-latest strategy: fail-fast: false matrix: browser: ['chrome', 'firefox', 'edge', 'safari'] env: BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} USE_LOCAL_BROWSER: 'false' TEST_BROWSER: ${{ matrix.browser }} steps: - uses: actions/checkout@v3 - name: Set up Node uses: actions/setup-node@v3 with: node-version: 20 cache: 'npm' cache-dependency-path: ./package-lock.json - name: Browser tests - ${{ matrix.browser }} working-directory: . run: | npm install npm run test-browser # crossbrowser_and_umd_unit_tests: # runs-on: ubuntu-latest # env: # BROWSER_STACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} # BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} # steps: # - uses: actions/checkout@v3 # - name: Set up Node # uses: actions/setup-node@v3 # with: # node-version: 16 # cache: 'npm' # cache-dependency-path: ./package-lock.json # - name: Cross-browser and umd unit tests # working-directory: . # run: | # npm install # npm run test-ci unit_tests: runs-on: ubuntu-latest strategy: matrix: node: ['18', '20', '22', '24'] steps: - uses: actions/checkout@v3 - name: Set up Node ${{ matrix.node }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: 'npm' cache-dependency-path: ./package-lock.json - name: Unit tests working-directory: . run: | npm install npm run coveralls - name: Coveralls Parallel uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./coverage/lcov.info flag-name: run-${{ matrix.node }} # This is a parallel build so need this parallel: true base-path: . # As testing against multiple versions need this to # finish the parallel build finish: name: Coveralls coverage needs: unit_tests runs-on: ubuntu-latest steps: - name: Coveralls Finished uses: coverallsapp/github-action@master with: github-token: ${{ secrets.github_token }} path-to-lcov: ./coverage/lcov.info parallel-finished: true base-path: .