Skip to content

Commit

Permalink
Simplify ci (#1590)
Browse files Browse the repository at this point in the history
* chore: update ci to avoid relying on artifacts.

Test coverage is generated once and uploaded once.

* chore: bump action version

* chore: remove unnecessary test coverage
  • Loading branch information
notaphplover authored Oct 22, 2024
1 parent 4510b36 commit 6cc8ed9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
38 changes: 21 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,25 @@ jobs:
matrix:
node-version: [18.x, 20.x]
ts-project: [src/tsconfig.json, src/tsconfig-es6.json]
exclude:
- node-version: 20.x
ts-project: src/tsconfig.json
env:
TS_NODE_PROJECT: ${{ matrix.ts-project }}

steps:
- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: npm ci
- name: Run tests
run: npm test --coverage
- name: Store code coverage report
uses: actions/upload-artifact@v4
with:
name: coverage
overwrite: true
path: coverage/
run: npm test

Build:
name: Compile source code
Expand All @@ -49,9 +46,9 @@ jobs:

steps:
- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand All @@ -63,18 +60,25 @@ jobs:
Upload_Coverage_Report:
name: Upload coverage report to codecov
environment: CI
env:
TS_NODE_PROJECT: src/tsconfig.json
needs: [Testing]
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Download Coverage report
uses: actions/download-artifact@v4.1.7
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
name: coverage
path: coverage/
node-version: 20.x
cache: npm
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: npm ci
- name: Run tests
run: npm test --coverage
- name: Codecov Upload
uses: codecov/codecov-action@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Calculate & Prepend Reading Time
uses: harunrst/[email protected]
Expand Down

0 comments on commit 6cc8ed9

Please sign in to comment.