mathjs/.github/workflows/foresight.yaml
Jos de Jong 0a093307b8
Setup Foresight testing workflow (#2802)
* Add Foresight configuration for Github Actions

* Temporarily update Foresight config to trigger in feature branch too

* Fix foresight config

* Change `test_path` to point to a folder with the test results

* Remove quotes from test_path

* Use the default naming of test-results.xml again

* Make the test output file explicit

* Remove redundant environment variables

* Only run foresight workflow on `main` and `develop` branches

* Upgrade to `actions/checkout@v3` and `actions/setup-node@v3` in the Github Actions workflows
2022-10-06 14:06:40 +02:00

53 lines
1.5 KiB
YAML

# This workflow will do a clean installation of node dependencies, cache/restore them, 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: Foresight CI Workflow
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Collect Workflow Telemetry
if: always()
uses: runforesight/foresight-workflow-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run test:src -- --reporter mocha-junit-reporter --reporter-options mochaFile=./test-results.xml
env:
CI: true
- name: Analyze Test and/or Coverage Results
if: always()
uses: runforesight/foresight-test-kit-action@v1
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
test_framework: JEST
test_format: JUNIT
test_path: ./test-results.xml