This repository was archived by the owner on Nov 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 268
128 lines (105 loc) 路 3.07 KB
/
Copy pathvalidate.yml
File metadata and controls
128 lines (105 loc) 路 3.07 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
name: 馃殌 Validate
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: 馃敤 Build and Validate
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22, 24]
steps:
- name: 馃摜 Checkout
uses: actions/checkout@v4
- name: 馃煝 Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: 馃摝 Install dependencies
run: npm ci
- name: 馃敤 Build
run: npm run build
- name: 馃捑 Cache build output
uses: actions/cache/save@v4
with:
path: |
dist/
key: build-${{ matrix.node-version }}-${{ github.sha }}
- name: 馃攳 Type check
run: npm run typecheck
- name: 馃Ч Lint
run: npm run lint
- name: 馃И Test
run: npm run test:coverage
- name: 馃搳 Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
e2e:
name: 馃寪 E2E Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [24]
steps:
- name: 馃摜 Checkout
uses: actions/checkout@v4
- name: 馃煝 Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: 馃摝 Install dependencies
run: npm ci
- name: 馃敤 Build
run: npm run build
# ensure we don't implicitly rely on dev dependencies
- name: 馃摝 Prune dependencies
run: npm prune --omit=dev
- name: 馃И Run cross-env e2e tests
run: node e2e/test-cross-env.js
- name: 馃悮 Run cross-env-shell e2e tests
run: node e2e/test-cross-env-shell.js
release:
name: 馃殌 Release
needs: [build, e2e]
runs-on: ubuntu-latest
if:
${{ github.repository == 'kentcdodds/cross-env' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
steps:
- name: 猬囷笍 Checkout repo
uses: actions/checkout@v4
- name: 馃攧 Restore build output
uses: actions/cache/restore@v4
with:
path: |
dist/
key: build-24-${{ github.sha }}
fail-on-cache-miss: false
- name: 馃殌 Release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 24
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}