-
Notifications
You must be signed in to change notification settings - Fork 178
152 lines (136 loc) · 4.74 KB
/
test.yml
File metadata and controls
152 lines (136 loc) · 4.74 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
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
149
150
151
152
name: Test
on:
push:
branches: [master]
pull_request: {}
jobs:
format-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up environment
uses: ./.github/actions/setup
- name: Check formatting
run: yarn format:check
- name: Run linter
run: yarn lint
deno-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Deno 1.46.3 (matching Netlify edge function environment)
uses: denoland/setup-deno@e95548e56dfa95d4e1a28d6f422fafe75c4c26fb # v2.0.3
with:
deno-version: '1.46.3'
- name: Set up environment
uses: ./.github/actions/setup
- name: Deno check API
run: yarn type:check:api
mcp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: yarn test
working-directory: packages/mcp
ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: yarn test
working-directory: packages/ui
build:
name: build (${{ matrix.package }}, ${{ matrix.variant }})
timeout-minutes: 90
strategy:
matrix:
package:
- solidity
- cairo
- confidential
- stellar
- stylus
- uniswap-hooks
# This variant config creates 2 branches of the matrix a default and a compile one to run the compile tests in their own job
variant:
- default
- compile
exclude:
- package: solidity
variant: compile
- package: cairo
variant: compile
- package: confidential
variant: compile
- package: stylus
variant: compile
- package: uniswap-hooks
variant: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Set up environment
uses: ./.github/actions/setup
# ----------------------------
# Solidity and Uniswap Hooks setup
- name: Install Foundry
if: matrix.package == 'solidity' || matrix.package == 'uniswap-hooks'
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de #v1.4.0
# ----------------------------
# Stellar compile setup
- name: Cache Rust dependencies
if: matrix.package == 'stellar' && matrix.variant == 'compile'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.cargo/bin/
runner/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ matrix.package }}
- name: Set up rust toolchain
if: matrix.package == 'stellar' && matrix.variant == 'compile'
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
with:
toolchain: stable, nightly
components: clippy, rustfmt, llvm-tools-preview
target: wasm32v1-none
# ----------------------------
- name: Compile TypeScript
run: yarn tsc
working-directory: packages/core/${{matrix.package}}
- name: Check Svelte
run: yarn svelte-check
working-directory: packages/ui
- name: Run tests
if: matrix.variant == 'default'
run: yarn test '**/*.test.ts' '**/test.ts' '!**/*.compile.test.ts'
working-directory: packages/core/${{matrix.package}}
- name: Get list of changed files
id: filter
if: matrix.variant == 'compile'
run: |
BASE=${{ github.event.pull_request.base.sha || github.event.before }}
echo "changes=$(git diff --name-only $BASE ${{ github.sha }} | tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Run tests
if: matrix.variant == 'compile' && contains(steps.filter.outputs.changes, format('packages/core/{0}/', matrix.package))
env:
RUSTFLAGS: ""
run: |
FILES=$(find ./ -type f -name '*.compile.test.ts')
if [ -z "$FILES" ]; then
echo "No compile tests found. Skipping."
exit 0
else
yarn test '**/*.compile.test.ts'
fi
working-directory: packages/core/${{matrix.package}}