-
Notifications
You must be signed in to change notification settings - Fork 7
79 lines (66 loc) · 2.39 KB
/
ci.yml
File metadata and controls
79 lines (66 loc) · 2.39 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
name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
registry-url: "https://registry.npmjs.org"
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: nextjs-cache
with:
path: packages/documentation/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
- run: pnpm install --frozen-lockfile
- run: pnpm ci-build
- run: pnpm ci-test
- run: pnpm ci-lint
- run: pnpm install --frozen-lockfile
- run: pnpm integration:generate
- run: pnpm integration:validate
- run: pnpm e2e:generate
- run: pnpm e2e:validate
- name: Check for uncommitted changes
run: ./scripts/assert-clean-working-directory.sh
# TODO: figure out how to do this safely, eg: no risk of external contributors exfiltrating publish secret.
# - name: Configure Git User
# run: |
# git config --global user.email "support@nahkies.co.nz"
# git config --global user.name "$GITHUB_ACTOR"
#
# - name: Check if able to publish changes
# run: npm whoami
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
#
# - name: Publish to NPM
# run: echo 'publish release' #pnpm lerna publish --no-private --force-publish --yes --conventional-commits
# if: github.ref == 'refs/heads/main'
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
#
# - name: Publish to NPM (Alpha)
# run: echo 'publish alpha release' #pnpm lerna publish --no-private --force-publish --yes --conventional-commits --canary
# if: github.ref != 'refs/heads/main'
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}