-
Notifications
You must be signed in to change notification settings - Fork 2
127 lines (122 loc) · 3.9 KB
/
Copy pathci.yml
File metadata and controls
127 lines (122 loc) · 3.9 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
on:
push:
branches:
- main
pull_request:
branches:
- main
name: CI-Pipeline
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
name: CI-Pipeline
NODE_OPTIONS: --max_old_space_size=7168
jobs:
validate:
name: Build & Test Package(s)
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 24.x]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Checkout Code
uses: actions/checkout@v7
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Enable Corepack
run: corepack enable && corepack install
- name: Get pnpm store directory
id: pnpm-store
run: echo "path=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm store
uses: actions/cache@v6
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Packages
run: pnpm install --frozen-lockfile
- name: Build Applications
run: pnpm build
- name: Test Applications
run: pnpm validate
- name: Validate Documentation
run: pnpm run docs
- name: Publish Code Coverage Report
uses: codecov/codecov-action@v7
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && success() && matrix.node-version == '24.x' }}
with:
slug: gradientedge/cdk-utils
token: ${{ env.CODECOV_TOKEN }}
- uses: actions/upload-artifact@v7
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && success() && matrix.node-version == '24.x' }}
with:
name: docs-artifact
path: ./api-docs/
release:
name: Release Package(s)
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && success() }}
runs-on: ubuntu-latest
needs: [validate]
strategy:
matrix:
node-version: [24.x]
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GIT_TOKEN }}
HUSKY: 0
steps:
- name: Checkout Code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Enable Corepack
run: corepack enable && corepack install
- name: Get pnpm store directory
id: pnpm-store
run: echo "path=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm store
uses: actions/cache@v6
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Packages
run: pnpm install --frozen-lockfile
- uses: actions/download-artifact@v8
with:
name: docs-artifact
path: ./api-docs/
- name: Build Production
run: pnpm build:production
- name: Create Release Pull Request or Publish
uses: changesets/action@v1
with:
title: 'chore: version packages'
commit: 'chore: version packages'
publish: pnpm release
version: pnpm changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deploy Documentation
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api-docs
- uses: geekyeggo/delete-artifact@v6
with:
name: |
docs-artifact
failOnError: false