diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 95caf3874..d19149689 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -33,8 +33,8 @@ jobs: test: needs: lint-build - name: "Test #${{ matrix.flavor }}: ${{ matrix.os }}, node v${{ matrix.node }}, ${{ matrix.typescript }}" - runs-on: ${{ matrix.os }} + name: "Test: ${{ matrix.os }}, node ${{ matrix.node }}, TS ${{ matrix.typescript }}" + runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false matrix: @@ -43,31 +43,48 @@ jobs: include: - flavor: 1 node: 10 - typescript: typescript@latest + nodeFlag: 10 + typescript: latest + typescriptFlag: latest - flavor: 2 node: 12.15 - typescript: typescript@latest + nodeFlag: 12_15 + typescript: latest + typescriptFlag: latest - flavor: 3 node: 12.16 - typescript: typescript@latest + nodeFlag: 12_16 + typescript: latest + typescriptFlag: latest - flavor: 4 node: 13 - typescript: typescript@latest + typescript: latest + typescriptFlag: latest - flavor: 5 node: 13 - typescript: typescript@2.7 + nodeFlag: 13 + typescript: 2.7 + typescriptFlag: 2_7 - flavor: 6 node: 13 - typescript: typescript@next + nodeFlag: 13 + typescript: next + typescriptFlag: next - flavor: 7 node: 14 - typescript: typescript@latest + nodeFlag: 14 + typescript: latest + typescriptFlag: latest - flavor: 8 node: 14 - typescript: typescript@2.7 + nodeFlag: 14 + typescript: 2.7 + typescriptFlag: 2_7 - flavor: 9 node: 14 - typescript: typescript@next + nodeFlag: 14 + typescript: next + typescriptFlag: next steps: # checkout code - uses: actions/checkout@v2 @@ -84,14 +101,22 @@ jobs: with: name: ts-node-packed.tgz path: tests/ - - run: npm install ${{ matrix.typescript }} --force + - run: npm install typescript@${{ matrix.typescript }} --force - run: npm run test-cov + - run: npm run coverage-report + if: ${{ always() }} + - name: Codecov + if: ${{ always() }} + uses: codecov/codecov-action@v1 + with: + flags: ${{ matrix.os }},node_${{ matrix.nodeFlag }},typescript_${{ matrix.typescriptFlag }} + - run: npm run coverage-fix-paths + - run: npm run coverage-report - name: Coveralls if: ${{ always() }} uses: coverallsapp/github-action@master with: github-token: ${{ secrets.github_token }} - flag-name: run-${{ matrix.os }}-${{ matrix.flavor }} parallel: true finish: needs: test diff --git a/.gitignore b/.gitignore index f359ce335..9b3c84d16 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ npm-debug.log dist/ tsconfig.schema.json tsconfig.schemastore-schema.json +.idea/ diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..28ca33092 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,4 @@ +fixes: + # Remap from npm-installed ts-node to root of project + # This can take the place of ./scripts/rewrite-coverage-paths.js + - "tests/node_modules/ts-node/::" diff --git a/package.json b/package.json index cd596c98e..fb0138c9c 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,10 @@ "build-configSchema": "typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema", "build-pack": "node ./scripts/build-pack.js", "test-spec": "mocha dist/**/*.spec.js -R spec --bail", - "test-cov": "nyc mocha -- \"dist/**/*.spec.js\" -R spec --bail && node ./scripts/rewrite-coverage-paths.js && nyc report --reporter=lcov", + "test-cov": "nyc mocha -- \"dist/**/*.spec.js\" -R spec --bail", "test": "npm run build && npm run lint && npm run test-cov", + "coverage-fix-paths": "node ./scripts/rewrite-coverage-paths.js", + "coverage-report": "nyc report --reporter=lcov", "prepare": "npm run build-nopack" }, "engines": {