-
-
Notifications
You must be signed in to change notification settings - Fork 1
132 lines (122 loc) · 3.42 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
# SPDX-FileCopyrightText: 2024 Dyne.org foundation
#
# SPDX-License-Identifier: AGPL-3.0-or-later
name: 🧪 Lint and test
on:
push:
branches:
- main
pull_request:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
node: [ 20 ]
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🔨 Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: ⏬ Install dependencies
run: pnpm recursive install
- uses: supercharge/[email protected]
with:
redis-version: 6
- name: Linting
continue-on-error: true
run: pnpm lint
- name: 🤖 Start pocketbase
run: |
./pkg/pocketbase/test/pocketbase serve &
while ! nc -z 0.0.0.0 8090; do echo "pocketbase not ready" && sleep 1; done
- name: 🧪 Run the tests
run: pnpm coverage
- name: 📨 Setup playwright
run: |
npx playwright install
npx playwright install-deps
pnpm build
pnpm exec playwright test
working-directory: ./pkg/browser
build_docs:
runs-on: ubuntu-latest
needs: build_and_test
if: github.ref == 'refs/heads/main'
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🎯 Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
name: 🔨 Install pnpm
with:
version: 8
- name: 📖 Setup Pages
uses: actions/configure-pages@v4
- name: ⏬ Install dependencies
run: pnpm install
- name: 🏗️ update sentences tabled and build the docs
run: pnpm build && pnpm run docs
- name: ⏫ Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
deploy_docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build_docs
runs-on: ubuntu-latest
name: Deploy documentation
steps:
- name: 📡 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
publish:
runs-on: ubuntu-latest
needs: build_and_test
if: github.ref == 'refs/heads/main'
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: 🎯 Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- name: 🔨 Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: ⏬ Install dependencies
run: pnpm i
- name: 🏗️ Build all
run: pnpm build
- name: 🌍 Build @slangroom/browser
run: pnpm build
working-directory: ./pkg/browser
- name: 📦 Releases
run: |
git config --global user.email "[email protected]" && git config --global user.name "Dev Dyne.org"
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc
pnpm whoami
pnpm publish:ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}