-
-
Notifications
You must be signed in to change notification settings - Fork 269
145 lines (135 loc) · 5.42 KB
/
Copy pathci.yml
File metadata and controls
145 lines (135 loc) · 5.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI
on:
push:
branches: [bundlephobia]
pull_request:
branches: [bundlephobia]
jobs:
build:
name: build (${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [26.x]
steps:
- uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
package-manager-cache: false
- name: Enable Corepack
run: corepack enable
- name: Get Yarn cache directory
id: yarn-cache
run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Cache Yarn packages
uses: actions/cache@v6
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn-${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}
- name: Install project dependencies
run: yarn install --immutable
- name: Cache Next.js build
uses: actions/cache@v6
with:
path: .next/cache
key: nextjs-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.sha }}
restore-keys: |
nextjs-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-
- name: Run lint
run: yarn lint
- name: Test package recommendation automation
run: yarn test:recommendations
- name: Type check
run: yarn typecheck
- run: yarn build
env:
CI: true
integration:
name: integration (${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [26.x]
steps:
- uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
package-manager-cache: false
- name: Enable Corepack
run: corepack enable
- name: Get Yarn cache directory
id: yarn-cache
run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Cache Yarn packages
uses: actions/cache@v6
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn-${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}
- name: Install project dependencies
run: yarn install --immutable
- name: Cache Next.js build
uses: actions/cache@v6
with:
path: .next/cache
key: nextjs-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.sha }}
restore-keys: |
nextjs-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-
- name: Build application for integration tests
run: yarn build
env:
CI: true
- name: Cache Playwright browsers
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
playwright-${{ runner.os }}-
- name: Install Playwright Chromium
run: yarn playwright install --with-deps chromium
- name: Run end-to-end tests
run: yarn test:e2e:run
env:
CI: true
- name: Upload Playwright report
if: ${{ !cancelled() && hashFiles('playwright-report/**') != '' }}
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: playwright-report/
retention-days: 14
jvm-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Use JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v6
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build JVM package workspace
working-directory: jvm-package-build-stats
run: ./gradlew build --no-daemon
- name: Verify Maven publication layout
working-directory: jvm-package-build-stats
run: |
./gradlew :core:publishMavenPublicationToReleaseTestRepository :cli:publishMavenPublicationToReleaseTestRepository --no-daemon
CORE_JAR=$(find build/release-test-repository/com/bundlephobia/jvm-package-build-stats-core/0.1.0-SNAPSHOT -name '*.jar' ! -name '*-sources.jar' ! -name '*-javadoc.jar' | head -1)
CLI_JAR=$(find build/release-test-repository/com/bundlephobia/jvm-package-build-stats-cli/0.1.0-SNAPSHOT -name '*.jar' ! -name '*-sources.jar' ! -name '*-javadoc.jar' | head -1)
CORE_POM=$(find build/release-test-repository/com/bundlephobia/jvm-package-build-stats-core/0.1.0-SNAPSHOT -name '*.pom' | head -1)
test -n "$CORE_JAR" && test -n "$CLI_JAR" && test -n "$CORE_POM"
jar tf "$CORE_JAR" | grep -q 'com/bundlephobia/jvm/PackageBuildStatsAnalyzer.class'
jar tf "$CORE_JAR" | grep -q 'org/objectweb/asm/ClassReader.class'
jar tf "$CLI_JAR" | grep -q 'com/bundlephobia/jvm/cli/MainKt.class'
java -jar "$CLI_JAR" --help | grep -q 'Analyze published JVM package size'
! grep -q '<dependencies>' "$CORE_POM"