-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (54 loc) · 1.74 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
name: CI
on: [push, pull_request]
jobs:
setup-compile-test-and-publish:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:11.4
options: >-
--health-cmd="mariadb-admin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
env:
MARIADB_ROOT_PASSWORD: my_root_password_for_tests
ports: ['3306:3306']
strategy:
fail-fast: false
matrix:
node:
- 22
- 23
include:
- node: 22
publish: true
continue-on-error: false
continue-on-error: ${{ matrix.continue-on-error == true }}
container:
image: node:${{ matrix.node }}
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Install the dependencies
run: yarn install --immutable
- name: Check the code formatting
run: yarn prettier --check .
- name: Compile the code
run: node --run compile
- name: Test
run: node --run test
env:
MARIADB_HOST: mariadb
MARIADB_PORT: 3306
MARIADB_ROOT_PASSWORD: my_root_password_for_tests
NODE_NO_WARNINGS: 1
- name: Lint package.json
run: yarn workspaces foreach --all --no-private run publint --strict
- name: Publish to npmjs
if: "matrix.publish == true && startsWith(github.ref, 'refs/tags/')"
run: |
yarn workspaces foreach --all --no-private exec npm version --no-workspaces-update --no-git-tag-version ${GITHUB_REF#refs/tags/}
yarn workspaces foreach --all --no-private npm publish --access public
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_AUTH_TOKEN }}