-
Notifications
You must be signed in to change notification settings - Fork 8
114 lines (110 loc) · 3.18 KB
/
ci_web.yml
File metadata and controls
114 lines (110 loc) · 3.18 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
name: ci-web
on:
workflow_call:
jobs:
validate-nginx-config:
uses: reearth/actions/.github/workflows/validate-nginx-config.yml@e05fcd1efc6c985c7c0c906cff1452ee634232c8
with:
template_directory: docker
template_values: '{"PORT": 8080, "REAL_IP_HEADER": "${{ vars.WEB_REAL_IP_HEADER }}"}' # Ref: https://github.com/reearth/reearth-cms/blob/main/web/Dockerfile#L35
working_directory: web
lint:
name: lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Install
run: yarn install --frozen-lockfile --prefer-offline
- name: Lint
run: yarn run lint
i18n:
name: i18n
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Install
run: yarn install --frozen-lockfile --prefer-offline
- name: Check translations
run: yarn i18n --ci
test:
name: test
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Install
run: yarn install --frozen-lockfile --prefer-offline
- name: Test
run: yarn run coverage
- name: Send coverage report
uses: codecov/codecov-action@v5
with:
flags: web
build:
name: build
needs: [lint, test, i18n]
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Cache TypeScript
uses: actions/cache@v5
with:
path: web/node_modules/.cache
key: ${{ runner.os }}-typescript-${{ hashFiles('web/tsconfig.json', 'web/package.json', 'web/yarn.lock') }}
restore-keys: |
${{ runner.os }}-typescript-
- name: Install
run: yarn install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
- name: Pack
if: github.ref_name == 'main' || github.ref_name == 'release'
run: |
mv dist reearth-cms-web
tar -zcvf reearth-cms-web.tar.gz reearth-cms-web
- name: Upload artifact
if: github.ref_name == 'main' || github.ref_name == 'release'
uses: actions/upload-artifact@v6
with:
name: reearth-cms-web
path: web/reearth-cms-web.tar.gz
if-no-files-found: error