Skip to content

Commit

Permalink
Merge pull request #16 from avixiii-dev/feat/real-user-monitoring
Browse files Browse the repository at this point in the history
Feat/real user monitoring
  • Loading branch information
xanaawakens authored Jan 13, 2025
2 parents de11187 + 579570e commit ccd33d6
Show file tree
Hide file tree
Showing 13 changed files with 798 additions and 355 deletions.
126 changes: 73 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
name: CI/CD
name: CI/CD Pipeline

on:
push:
branches: [ master ]
branches: [ master, develop ]
tags: ['v*']
pull_request:
branches: [ master ]
branches: [ master, develop ]
release:
types: [created]

permissions:
contents: write
packages: write

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
Expand All @@ -23,78 +31,90 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Clean install dependencies
run: |
rm -f package-lock.json
npm install
- name: Run linter

- name: Install dependencies
run: npm ci

- name: Run linting
run: npm run lint

- name: Run tests
run: npm test

- name: Build
run: npm run build

- name: Run tests with coverage
run: npm run test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true

test-integration:
build:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
test-project: [webpack-test, rollup-test, vite-test]

if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/v'))

steps:
- uses: actions/checkout@v3

- name: Use Node.js 18
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '18.x'
cache: 'npm'

- name: Install package dependencies
run: |
rm -f package-lock.json
npm install

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Install test project dependencies
working-directory: test-projects/${{ matrix.test-project }}
run: |
rm -f package-lock.json
npm install
- name: Build test project
working-directory: test-projects/${{ matrix.test-project }}
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
retention-days: 5

publish:
needs: [test, test-integration]
needs: [test, build]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v3

- name: Use Node.js 18
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'


- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist/

- name: Install dependencies
run: |
rm -f package-lock.json
npm install
- name: Build
run: npm run build

- name: Publish to npm
run: npm ci

- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*
README.md
LICENSE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit ccd33d6

Please sign in to comment.