Skip to content

ci: enable codecov action #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ concurrency:
cancel-in-progress: true

jobs:
default:
ci:
name: Lint and Test with Node.js ${{ matrix.node }} on ${{ matrix.os }}
strategy:
matrix:
node:
- 16
- 18
- 20
- 22
Expand All @@ -24,8 +23,6 @@ jobs:
- macos-latest
fail-fast: false
runs-on: ${{ matrix.os }}
env:
YARN_IGNORE_NODE: 1
steps:
- uses: actions/checkout@v4

Expand All @@ -38,12 +35,14 @@ jobs:
- name: Install Dependencies
run: yarn --immutable

- name: Build and Typecov
run: yarn run-s build typecov
- name: Build, Lint and Test
run: |
yarn build
yarn run-p lint test typecov
env:
EFF_NO_LINK_RULES: true
PARSER_NO_WATCH: true

- name: Lint and Test
if: ${{ matrix.node != 16}}
run: yarn run-s lint test
- name: Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
54 changes: 30 additions & 24 deletions tests/e2e/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import path from 'node:path'
import { tryFile } from '@pkgr/core'
import { exec } from 'tinyexec'

const TIMEOUT = 30_000

describe('e2e cases', async () => {
const { dirname } = import.meta

Expand All @@ -26,31 +28,35 @@ describe('e2e cases', async () => {
})
}

it('should exec eslint successfully', async () => {
const eslintConfig = tryFile('eslint.config.js', false, absoluteDir)
expect(
await exec(
'yarn',
[
'eslint',
...(eslintConfig
? ['-c', eslintConfig]
: ['--ignore-pattern', '!.dot']),
'--ext',
'cjs,cts,js,jsx,mjs,mts,ts,tsx',
'--report-unused-disable-directives',
absoluteDir,
],
{
nodeOptions: {
env: {
ESLINT_USE_FLAT_CONFIG: eslintConfig ? undefined : 'false',
NODE_OPTIONS: '--no-warnings=ESLintRCWarning',
it(
`should exec eslint successfully > ${dirName}`,
async () => {
const eslintConfig = tryFile('eslint.config.js', false, absoluteDir)
expect(
await exec(
'yarn',
[
'eslint',
...(eslintConfig
? ['-c', eslintConfig]
: ['--ignore-pattern', '!.dot']),
'--ext',
'cjs,cts,js,jsx,mjs,mts,ts,tsx',
'--report-unused-disable-directives',
absoluteDir,
],
{
nodeOptions: {
env: {
ESLINT_USE_FLAT_CONFIG: eslintConfig ? undefined : 'false',
NODE_OPTIONS: '--no-warnings=ESLintRCWarning',
},
},
},
},
),
).toMatchSnapshot(dirName)
})
),
).toMatchSnapshot()
},
TIMEOUT,
)
}
})