Skip to content

Commit cd72974

Browse files
committed
feat: Update CI/CD pipeline in README and workflow configuration
1 parent 4101281 commit cd72974

File tree

2 files changed

+58
-11
lines changed

2 files changed

+58
-11
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: CI/CD Pipeline
22

33
on:
44
push:
@@ -7,7 +7,23 @@ on:
77
branches: [main]
88

99
jobs:
10-
build:
10+
validate:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: pnpm/action-setup@v2
15+
with:
16+
version: 8
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
cache: 'pnpm'
21+
- run: pnpm install
22+
- run: pnpm lint
23+
- run: pnpm type-check
24+
25+
test:
26+
needs: validate
1127
runs-on: ubuntu-latest
1228
strategy:
1329
matrix:
@@ -17,14 +33,31 @@ jobs:
1733
- uses: pnpm/action-setup@v2
1834
with:
1935
version: 8
20-
- name: Use Node.js 18
21-
uses: actions/setup-node@v3
36+
- uses: actions/setup-node@v3
2237
with:
2338
node-version: 18
24-
cache: 'pnpm'
25-
- name: Install dependencies
26-
run: pnpm install
27-
- name: Build ${{ matrix.package }}
28-
run: pnpm --filter @mixcore/${{ matrix.package }} build
29-
- name: Run tests for ${{ matrix.package }}
30-
run: pnpm --filter @mixcore/${{ matrix.package }} test
39+
- run: pnpm install
40+
- run: pnpm --filter @mixcore/${{ matrix.package }} test
41+
- name: Coverage
42+
uses: codecov/codecov-action@v3
43+
with:
44+
token: ${{ secrets.CODECOV_TOKEN }}
45+
directory: ./packages/${{ matrix.package }}/coverage
46+
47+
publish:
48+
needs: test
49+
if: github.ref == 'refs/heads/main'
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v3
53+
- uses: pnpm/action-setup@v2
54+
with:
55+
version: 8
56+
- uses: actions/setup-node@v3
57+
with:
58+
node-version: 18
59+
registry-url: https://registry.npmjs.org/
60+
- run: pnpm install
61+
- run: pnpm build
62+
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
63+
- run: pnpm --filter @mixcore/* publish --access public

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ pnpm test
106106

107107
Test coverage reports are generated in `coverage/` directory.
108108

109+
## CI/CD Pipeline
110+
111+
The SDK uses GitHub Actions for continuous integration and deployment:
112+
113+
1. **Validate**: Runs linting and type checking
114+
2. **Test**: Runs unit tests with coverage reporting via Codecov
115+
3. **Publish**: Automatically publishes to npm on main branch merges
116+
117+
### Publishing Requirements
118+
119+
- All packages must pass tests with minimum 80% coverage
120+
- Version numbers must follow semantic versioning
121+
- NPM_TOKEN secret must be configured in GitHub
122+
109123
## Contributing
110124

111125
Contributions welcome! Please see our [Contribution Guidelines](CONTRIBUTING.md).

0 commit comments

Comments
 (0)