Skip to content

Commit

Permalink
ci: update ci flow
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Dec 17, 2023
1 parent a44f1f1 commit dcb9941
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 57 deletions.
24 changes: 24 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -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
80 changes: 25 additions & 55 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default defineConfig({
test: {
globals: true,
coverage: {
provider: 'v8',
reporter: ['text', 'lcov', 'clover']
enabled: true,
reporter: ['text', 'lcov', 'cobertura']
}
},
esbuild: {
Expand Down

0 comments on commit dcb9941

Please sign in to comment.