diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..8f503e2 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,60 @@ +# This is a basic workflow to help you get started with Actions + +name: tests + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + Build_Test: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [8.12,15.x] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout Repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + # Runs a single command using the runners shell + - name: Setup Node ${{ matrix.node-version }} + uses: actions/setup-node@v2.1.5 + with: + always-auth: false + node-version: ${{ matrix.node-version }} + + + - name: Run npm install + run: npm install + + - name: Run Tests + if: ${{ matrix.node-version == 8.12 }} + run: npm run test:clscover + env: + CI: true + + - name: Run Tests + if: ${{ matrix.node-version != 8.12 }} + run: npm run cover + env: + CI: true + + - name: Update Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: Unit Test + if: success()