chore: version packages (#581) #1646
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: Main | |
on: | |
pull_request: | |
push: | |
branches: [main, next] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
install: | |
name: Install | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18] | |
pnpm-version: [8] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/[email protected] | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: Set up Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
cache: "pnpm" | |
node-version: ${{ matrix.node-version }} | |
- name: Cache pnpm | |
uses: actions/cache@v4 | |
with: | |
path: ~/.pnpm-store | |
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
restore-keys: pnpm- | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
examples/*/node_modules | |
packages/*/node_modules | |
packages/**/dist | |
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | |
- name: Install Dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: | | |
pnpm i --ignore-scripts | |
pnpm postinstall | |
build: | |
name: Build | |
needs: install | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18] | |
pnpm-version: [8] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/[email protected] | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: Set up Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
cache: "pnpm" | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
examples/*/node_modules | |
packages/*/node_modules | |
packages/**/dist | |
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | |
- name: Build | |
run: pnpm build | |
- name: Build Examples | |
run: pnpm build:examples | |
- name: Upload Core dist as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: core-dist | |
path: packages/core/dist | |
- name: Upload Core-React dist as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: core-react-dist | |
path: packages/core-react/dist | |
- name: Upload Core-Web dist as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: core-web-dist | |
path: packages/core-web/dist | |
- name: Upload React dist as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: react-dist | |
path: packages/react/dist | |
lint: | |
name: Lint | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18] | |
pnpm-version: [8] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/[email protected] | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: Set up Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
cache: "pnpm" | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
examples/*/node_modules | |
packages/*/node_modules | |
packages/**/dist | |
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: core-dist | |
path: packages/core/dist | |
- uses: actions/download-artifact@v4 | |
with: | |
name: core-react-dist | |
path: packages/core-react/dist | |
- uses: actions/download-artifact@v4 | |
with: | |
name: core-web-dist | |
path: packages/core-web/dist | |
- uses: actions/download-artifact@v4 | |
with: | |
name: react-dist | |
path: packages/react/dist | |
- name: Lint code | |
run: pnpm lint | |
test: | |
name: Test | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18] | |
pnpm-version: [8] | |
react-version: [18] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/[email protected] | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: Set up Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
cache: "pnpm" | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
examples/*/node_modules | |
packages/*/node_modules | |
packages/**/dist | |
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: core-dist | |
path: packages/core/dist | |
- uses: actions/download-artifact@v4 | |
with: | |
name: core-react-dist | |
path: packages/core-react/dist | |
- uses: actions/download-artifact@v4 | |
with: | |
name: core-web-dist | |
path: packages/core-web/dist | |
- uses: actions/download-artifact@v4 | |
with: | |
name: react-dist | |
path: packages/react/dist | |
- name: Test React 18 | |
run: pnpm test:coverage | |
env: | |
REACT_VERSION: ${{ matrix.react-version }} | |
STUDIO_API_KEY: ${{ secrets.STUDIO_API_KEY }} | |
security-codeql: | |
name: Security (CodeQL) | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
security-events: write | |
strategy: | |
matrix: | |
node-version: [18] | |
pnpm-version: [8] | |
react-version: [18] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/[email protected] | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: Set up Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
cache: "pnpm" | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
examples/*/node_modules | |
packages/*/node_modules | |
packages/**/dist | |
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: typescript | |
queries: security-extended,security-and-quality | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
security-dependency-review: | |
name: Security (Dependency Review) | |
needs: build | |
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/next' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
node-version: [18] | |
pnpm-version: [8] | |
react-version: [18] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/[email protected] | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: Set up Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
cache: "pnpm" | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
examples/*/node_modules | |
packages/*/node_modules | |
packages/**/dist | |
key: modules-${{ hashFiles('pnpm-lock.yaml') }} | |
- name: Dependency Review | |
uses: actions/dependency-review-action@v4 |