-
-
Notifications
You must be signed in to change notification settings - Fork 127
148 lines (123 loc) · 3.79 KB
/
ci-run.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: CI
on:
pull_request:
types:
- ready_for_review
- reopened
- opened
- synchronize
branches:
- main
- dev
push:
branches:
- main
- dev
# manual trigger from Github UI - Action tab
workflow_dispatch:
env:
NEXT_PUBLIC_INFURA_NETWORK: mainnet
PRE_RENDER_INFURA_ID: ${{ secrets.PRE_RENDER_INFURA_ID }}
SUBGRAPH_URL: ${{ secrets.SUBGRAPH_URL }}
NEXT_PUBLIC_SUBGRAPH_URL: ${{ secrets.NEXT_PUBLIC_SUBGRAPH_URL }}
NEXT_PUBLIC_V4_SUBGRAPH_URL: ${{ secrets.NEXT_PUBLIC_V4_SUBGRAPH_URL }}
NEXT_PUBLIC_V4_SEPOLIA_SUBGRAPH_URL: ${{ secrets.NEXT_PUBLIC_V4_SEPOLIA_SUBGRAPH_URL }}
jobs:
jest:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
run: yarn install
- name: Tests with yarn
run: yarn test
lint-translations:
name: Lint translation source files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
run: yarn install
- name: Lint translations template
run: 'yarn i18n:lint'
- uses: tj-actions/changed-files@v41
id: changed-files
with:
files: '**/*.po'
- name: Check for modified translation source files
if: steps.changed-files.outputs.any_changed == 'true' && github.event_name == 'pull_request'
run: |
echo "🍎 PRs should not change .po files. Only changes to the messages.pot are allowed."
exit 1
compile:
name: Compile Typescript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
run: yarn install --frozen-lockfile
- name: Codegen
run: 'yarn codegen'
- name: Compile
run: 'yarn ts:compile'
# build-db-types:
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 20
# - uses: supabase/[email protected]
# - name: Start Supabase local development setup
# run: supabase start
# - name: Verify generated types are up-to-date
# run: |
# npm i -g prettier
# supabase gen types typescript --local > src/types/database.types.ts
# prettier --write src/types/database.types.ts
# if [ "$(git diff --ignore-space-at-eol src/types/database.types.ts | wc -l)" -gt "0" ]; then
# echo "Detected uncommitted changes after build. See status below:"
# git diff
# exit 1
# fi
# next-build:
# name: Build
# runs-on: ubuntu-latest
# needs: compile
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 20
# - uses: actions/cache@v2
# with:
# path: '**/node_modules'
# key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
# - name: Install packages
# run: yarn install --frozen-lockfile
# - name: Build NextJS app
# run: 'yarn build'