diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..7f0fdc0 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,53 @@ +name: Unit tests + +on: + push: + branches: + - master + - next + pull_request: + branches: + - master + - next + +jobs: + test-node: + name: Test on Node.js v${{ matrix.node-version }} and Jest v${{ matrix.jest-version }} + strategy: + fail-fast: false + matrix: + node-version: [10.x, 12.x, 13.x, 14.x, 16.x] + jest-version: [24, 25, 26] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - name: install with jest v${{ matrix.jest-version }} + run: | + yarn + yarn add --dev jest@${{ matrix.jest-version }} babel-jest@${{ matrix.jest-version }} + - name: run tests + run: yarn test + test-os: + name: Test on ${{ matrix.os }} using Node.js LTS + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14.x + cache: yarn + - name: install + run: yarn + - name: run tests + run: yarn test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 396d563..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "10" - - "12" - - "13" - - "14" -env: - - JEST_VERSION=^24.0.0 - - JEST_VERSION=^25.0.0 - - JEST_VERSION=^26.0.0 -script: - - npm run test:ci diff --git a/README.md b/README.md index 431682e..b89eb23 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/jest-community/jest-junit.svg?branch=master)](https://travis-ci.org/jest-community/jest-junit) +[![Actions Status](https://github.com/jest-community/jest-junit/actions/workflows/nodejs.yml/badge.svg?branch=master)](https://github.com/jest-community/jest-junit/actions) # jest-junit A Jest reporter that creates compatible junit xml files diff --git a/package.json b/package.json index b512c30..7a72fcd 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,7 @@ "constants" ], "scripts": { - "test": "jest", - "pretest:ci": "npm uninstall jest babel-jest && npm install jest@$JEST_VERSION babel-jest@$JEST_VERSION --no-save", - "test:ci": "jest --ci" + "test": "jest" }, "dependencies": { "mkdirp": "^1.0.4",