name: repo-checks
on: [push]
jobs:
  main:
    name: node_js-matrix
    runs-on: [ self-hosted, zendesk-stable ]
    strategy:
      matrix:
        task:
          - lint
          - test-with-coverage > lcov.txt
        version:
          - 8
          - 10
          - 12
    steps:
    - uses: zendesk/checkout@v2
      with:
        fetch-depth: 0
    - uses: zendesk/setup-node@v2.0.0
      with:
        node-version: ${{ matrix.version }}
    - name: node_js ${{ matrix.version }} ${{ matrix.task}}
      run: |
        git config --global url."https://${{ secrets.ORG_GITHUB_TOKEN }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
        curl -u "$ARTIFACTORY_USERNAME:$ARTIFACTORY_API_KEY" --fail https://zdrepo.jfrog.io/zdrepo/api/npm/npm/auth/zendesk >> ~/.npmrc
        npm install
        npm run ${{ matrix.task}}
    - name: after_success
      if: success()
      run: |
        if [ -r lcov.txt ]
        then
          bash <(curl -s https://raw.githubusercontent.com/zendesk/codecov-bash/master/codecov) -t $CODECOV_TOKEN -f lcov.txt
        fi
  deploy:
    name: node_js-deploy
    needs: main
    runs-on: [ self-hosted, zendesk-stable ]
    steps:
    - uses: zendesk/checkout@v2
      with:
        fetch-depth: 0
    - uses: zendesk/setup-node@v2.0.0
      with:
        node-version: 12
    - name: publish
      if: github.ref == 'refs/heads/master'
      run: |
        if $(npm v -json | jq --raw-output '."dist-tags".latest') != $(jq --raw-output .version package.json)
        then
          npm install
          npm publish
        fi

Add GitHub Actions workflows to migrate away from Travis-CI
Add GitHub Actions workflows to migrate away from Travis-CI
