ci: codecov adjusments #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
outputs: | |
store_path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Node.js version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
id: pnpm-install | |
with: | |
version: 10 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-node-22-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-node-22-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
lint: | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Node.js version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 10 | |
- name: Use pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ needs.prepare.outputs.store_path }} | |
key: ${{ runner.os }}-node-22-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-node-22-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --offline | |
- name: Run ESLint | |
run: pnpm lint | |
typecheck: | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Node.js version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 10 | |
- name: Use pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ needs.prepare.outputs.store_path }} | |
key: ${{ runner.os }}-node-22-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-node-22-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --offline | |
- name: Run TypeScript Typecheck | |
run: pnpm run typecheck | |
unit-test: | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Node.js version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 10 | |
- name: Use pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ needs.prepare.outputs.store_path }} | |
key: ${{ runner.os }}-node-22-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-node-22-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --offline | |
- name: Run Tests with Coverage | |
run: pnpm run test:coverage | |
- name: Upload Coverage Reports | |
uses: codecov/codecov-action@v5 | |
with: | |
fail_ci_if_error: true | |
files: ./test-report.junit.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload Test Results | |
uses: codecov/test-results-action@v1 | |
with: | |
fail_ci_if_error: true | |
files: ./coverage/cobertura-coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} |