Skip to content

Commit 87f1c52

Browse files
authored
ci: update workflows to include license checks and tagging (#2)
1 parent 78d5470 commit 87f1c52

File tree

39 files changed

+195
-499
lines changed

39 files changed

+195
-499
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Cache Monorepo
2+
description: Cache pnpm store and Nx cache for monorepo workflows
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Cache pnpm store
7+
uses: actions/cache@v4
8+
with:
9+
path: .pnpm-store
10+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
11+
restore-keys: |
12+
${{ runner.os }}-pnpm-store-
13+
14+
- name: Cache Nx cache
15+
uses: actions/cache@v4
16+
with:
17+
path: .nx/cache
18+
key: ${{ runner.os }}-nx-cache-${{ github.sha }}
19+
restore-keys: |
20+
${{ runner.os }}-nx-cache-

.github/workflows/ci.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
env:
10+
HUSKY: 0
911

1012
jobs:
1113
build:
1214
environment: test
1315
runs-on: ubuntu-latest
1416
steps:
1517
- uses: actions/checkout@v4
18+
19+
- name: Cache monorepo
20+
uses: ./.github/actions/cache-monorepo
1621

1722
- name: Install pnpm
1823
uses: pnpm/action-setup@v2
@@ -24,13 +29,16 @@ jobs:
2429
with:
2530
node-version-file: '.nvmrc'
2631
cache: 'pnpm'
27-
28-
32+
33+
2934
- name: Install dependencies
3035
run: pnpm install
3136

3237
- name: Check
33-
run: pnpm nx run-many --target=build,lint,test --parallel=3 --exclude="@storyblok/playground-*"
38+
run: pnpm nx run-many --target=build,lint,test --parallel=3 -p="tag:npm:public"
3439
env:
3540
VITE_ACCESS_TOKEN: ${{ secrets.VITE_ACCESS_TOKEN }}
3641
VITE_SPACE_ID: ${{ vars.VITE_SPACE_ID }}
42+
43+
- name: Check Licenses
44+
run: pnpm nx exec -p="tag:npm:public" -- pnpm -w monoblok license check \$NX_PROJECT_NAME

.github/workflows/pr-preview.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches: [ main ]
66

7+
env:
8+
HUSKY: 0
9+
710
jobs:
811
preview:
912
runs-on: ubuntu-latest
@@ -14,6 +17,9 @@ jobs:
1417
steps:
1518
- uses: actions/checkout@v4
1619

20+
- name: Cache monorepo
21+
uses: ./.github/actions/cache-monorepo
22+
1723
- name: Install pnpm
1824
uses: pnpm/action-setup@v2
1925
with:
@@ -24,14 +30,12 @@ jobs:
2430
with:
2531
node-version-file: '.nvmrc'
2632
cache: 'pnpm'
27-
registry-url: 'https://npm.pkg.github.com'
28-
scope: '@storyblok'
2933

3034
- name: Install dependencies
3135
run: pnpm install
3236

3337
- name: Build
34-
run: pnpm nx run-many --target=build --parallel=5 --exclude="@storyblok/playground-*"
38+
run: pnpm nx run-many --target=build --parallel=5 -p="tag:npm:public"
3539

3640
- name: Generate PR version
3741
id: pr-version

lint-staged.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @type {import('lint-staged').Configuration}
55
*/
66
export default {
7-
'{packages,tools}/**/*.{js,ts,jsx,tsx,astro}': [
7+
'{packages,tools}/**/*.{js,ts,jsx,tsx,astro,json}': [
88
(filenames) => `pnpm exec nx affected -t=lint --exclude="@storyblok/playground-*" --files=${filenames.join(',')} -- --fix`,
99
]
1010
};

packages/astro/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"test:e2e": "start-server-and-test playground:test http://localhost:4321/ cy:run",
6767
"test:e2e-watch": "start-server-and-test playground:test http://localhost:4321/ cy:open",
6868
"cy:run": "cypress run",
69-
"cy:open": "cypress open",
70-
"check-licenses": "node scripts/license-checker.mjs"
69+
"cy:open": "cypress open"
7170
},
7271
"peerDependencies": {
7372
"astro": "^3.0.0 || ^4.0.0 || ^5.0.0"
@@ -88,7 +87,6 @@
8887
"eslint-config-prettier": "^10.0.1",
8988
"eslint-plugin-astro": "^1.3.1",
9089
"eslint-plugin-cypress": "^4.3.0",
91-
"license-checker": "^25.0.1",
9290
"prettier": "^3.4.2",
9391
"prettier-plugin-astro": "^0.13.0",
9492
"start-server-and-test": "^2.0.11",
@@ -145,6 +143,9 @@
145143
"nx": {
146144
"implicitDependencies": [
147145
"!@storyblok/playground-*"
146+
],
147+
"tags": [
148+
"type:lib"
148149
]
149150
}
150151
}

packages/astro/playground/ssg/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@storyblok/playground-astro-ssg",
33
"version": "0.0.0",
4+
"private": true,
45
"scripts": {
56
"dev": "astro dev",
67
"start": "astro dev",

packages/astro/playground/ssr/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@storyblok/playground-astro-ssr",
33
"version": "0.0.0",
4+
"private": true,
45
"scripts": {
56
"dev": "astro dev",
67
"start": "astro dev",

packages/astro/playground/test/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@storyblok/playground-astro-test",
33
"version": "0.0.0",
4+
"private": true,
45
"scripts": {
56
"dev": "astro dev",
67
"start": "astro dev",

packages/astro/scripts/license-checker.mjs

Lines changed: 0 additions & 54 deletions
This file was deleted.

packages/js/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
"lint": "eslint .",
4040
"lint:fix": "eslint . --fix",
4141
"cy:run": "cypress run",
42-
"cy:open": "cypress open",
43-
"check-licenses": "node scripts/license-checker.mjs"
42+
"cy:open": "cypress open"
4443
},
4544
"dependencies": {
4645
"@storyblok/richtext": "workspace:*",
@@ -56,7 +55,6 @@
5655
"eslint-plugin-cypress": "^4.3.0",
5756
"jsdom": "^26.0.0",
5857
"kolorist": "^1.8.0",
59-
"license-checker": "^25.0.1",
6058
"pathe": "^2.0.3",
6159
"start-server-and-test": "^2.0.11",
6260
"typescript": "5.8.3",

0 commit comments

Comments
 (0)