diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..e84f838 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,28 @@ +name: coverage + +on: + push: + paths-ignore: + - '*.md' + pull_request: + +env: + CI: true + NODE_ENV: cov + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + - run: npm install + - name: run coverage + run: npx -y nyc npm test + #run: npx -y c8 --reporter=lcov npm test + - name: codecov + uses: codecov/codecov-action@v3 + # - name: Coveralls + # uses: coverallsapp/github-action@master + # with: + # github-token: ${{ secrets.github_token }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c699a30..e26c834 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,17 +10,34 @@ on: jobs: build: - runs-on: ubuntu-latest + needs: [ get-lts ] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, windows-latest ] + node: + - ${{ fromJson(needs.get-lts.outputs.active) }} + - 21 steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version: ${{ matrix.node }} - name: Install dependencies run: npm install - name: Build run: npm run build - name: Test run: npm test + + get-lts: + runs-on: ubuntu-latest + steps: + - id: get + uses: msimerson/node-lts-versions@v1 + outputs: + lts: ${{ steps.get.outputs.lts }} + active: ${{ steps.get.outputs.active }} diff --git a/.gitignore b/.gitignore index a67db4a..02c60a5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ punycode.es6.js # Coverage report coverage +.nyc_output # Installed npm modules node_modules diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 209e3ef..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/package.json b/package.json index b8b76fc..5f6eceb 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "punycode.es6.js" ], "scripts": { - "test": "mocha tests", + "test": "npx mocha tests", "build": "node scripts/prepublish.js" }, "devDependencies": {