diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 000000000..e42b15ed4 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,24 @@ +codecov: + notify: + after_n_builds: 4 + strict_yaml_branch: main + +coverage: + range: '50...100' + status: + project: + default: + target: auto + threshold: 5% + patch: off + +flag_management: + default_rules: + statuses: + - type: project + target: auto + threshold: 2% + +comment: + require_changes: true + after_n_builds: 4 diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e2e71b32f..1c55d89e1 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -12,11 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Add problem matcher run: echo "::add-matcher::.github/problemMatchers/eslint.json" - name: Use Node.js v20 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20 cache: yarn @@ -26,81 +26,51 @@ jobs: - name: Run ESLint run: yarn lint --fix=false - Testing: - name: Unit Tests + docs: + name: Generate Documentation runs-on: ubuntu-latest steps: - name: Checkout Project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Use Node.js v20 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20 cache: yarn registry-url: https://registry.npmjs.org/ - name: Install Dependencies run: yarn --immutable - - name: Run tests - run: yarn test --coverage - - name: Store code coverage report - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage/ + - name: Generate Documentation + run: yarn docs - Building: - name: Compile source code + BuildingAndTesting: + name: Building and Testing with node v${{ matrix.node }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node: [18, 19, 20, 21] steps: - name: Checkout Project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Add problem matcher run: echo "::add-matcher::.github/problemMatchers/tsc.json" - - name: Use Node.js v20 - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: yarn - registry-url: https://registry.npmjs.org/ - - name: Install Dependencies - run: yarn --immutable - - name: Build Code - run: yarn build - - docs: - name: Generate Documentation - runs-on: ubuntu-latest - steps: - - name: Checkout Project - uses: actions/checkout@v3 - - name: Use Node.js v20 - uses: actions/setup-node@v3 + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v4 with: - node-version: 20 + node-version: ${{ matrix.node }} cache: yarn registry-url: https://registry.npmjs.org/ - name: Install Dependencies run: yarn --immutable - - name: Generate Documentation - run: yarn docs - - Upload_Coverage_Report: - name: Upload coverage report to codecov - needs: [Testing] - runs-on: ubuntu-latest - steps: - - name: Checkout Project - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - name: Download Coverage report - uses: actions/download-artifact@v3 - with: - name: coverage - path: coverage/ - - name: Codecov Upload + - name: Typecheck And Build Code + run: yarn typecheck && yarn build + - name: Run tests + run: yarn test + - name: Codecov Upload ${{ matrix.node }} uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} - directory: coverage/ + files: coverage/cobertura-coverage.xml + flags: ${{ matrix.node }} fail_ci_if_error: true diff --git a/vitest.config.ts b/vitest.config.ts index a852f7488..4d24a99d2 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -4,8 +4,8 @@ export default defineConfig({ test: { globals: true, coverage: { - provider: 'v8', - reporter: ['text', 'lcov', 'clover'] + enabled: true, + reporter: ['text', 'lcov', 'cobertura'] } }, esbuild: {