-
Notifications
You must be signed in to change notification settings - Fork 15
141 lines (133 loc) · 3.89 KB
/
ci.yml
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
# caching pnpm deps: https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
AXIOM_TOKEN: ${{ secrets.TESTING_STAGING_E2E_TOKEN }}
AXIOM_URL: ${{ secrets.TESTING_STAGING_API_URL }}
AXIOM_ORG_ID: ${{ secrets.TESTING_STAGING_E2E_ORG_ID }}
NEXT_PUBLIC_AXIOM_TOKEN: ${{ secrets.TESTING_STAGING_E2E_TOKEN }}
NEXT_PUBLIC_AXIOM_URL: ${{ secrets.TESTING_STAGING_API_URL }}
NEXT_PUBLIC_AXIOM_ORG_ID: ${{ secrets.TESTING_STAGING_E2E_ORG_ID }}
AXIOM_DATASET_SUFFIX: ${{ github.run_id }}
NODEVERSION: 20.x
PNPM_VERSION: 9.1.1
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 18.x
- 20.x
- 22.x
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm build && pnpm build:cjs
- run: pnpm lint
- run: pnpm test
check-winston-example:
name: Check Winston example
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 18.x
- 20.x
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm build && pnpm build:cjs
- run: cd examples/winston && pnpm example
test-integration:
name: Test (Integration)
runs-on: ubuntu-latest
needs: build
if: github.event.pull_request.head.repo.full_name == github.repository
strategy:
matrix:
node:
- 18.x
- 20.x
max-parallel: 1
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm build && pnpm build:cjs
- env:
AXIOM_DATASET_SUFFIX: ${{ github.run_id }}-${{ matrix.node }}
run: pnpm integration
deploy-e2e-apps:
name: Deploy E2E apps
runs-on: ubuntu-latest
needs: build
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25 #deploy
id: vercel-deploy
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required
scope: ${{ secrets.VERCEL_SCOPE }}
outputs:
preview-url: ${{ steps.vercel-deploy.outputs.preview-url }}
environment:
name: E2EPreview
url: ${{ steps.vercel-deploy.outputs.preview-url }}
test-e2e:
name: E2E tests
runs-on: ubuntu-latest
needs:
- deploy-e2e-apps
if: github.event.pull_request.head.repo.full_name == github.repository
strategy:
matrix:
node:
- 20.x
max-parallel: 1
fail-fast: true
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm build && pnpm build:cjs # cjs build needed to run tests
- env:
TESTING_TARGET_URL: ${{ needs.deploy-e2e-apps.outputs.preview-url }}
run: pnpm run e2e