Repository navigation
96 lines (82 loc) · 2.79 KB
/
Copy pathsdk.yml
File metadata and controls
96 lines (82 loc) · 2.79 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
name: SDK CI
on:
push:
branches:
- main
- changeset-release/**
paths:
- 'packages/sdk/**'
- 'packages/eth/**'
- 'packages/fixed-decimal/**'
- 'packages/spl/**'
- 'package-lock.json'
- '.github/workflows/sdk.yml'
pull_request:
paths:
- 'packages/sdk/**'
- 'packages/eth/**'
- 'packages/fixed-decimal/**'
- 'packages/spl/**'
- 'package-lock.json'
- '.github/workflows/sdk.yml'
workflow_dispatch:
# Cancel superseded PR runs when new commits are pushed.
concurrency:
group: sdk-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
NODE_VERSION: '24.10.0'
jobs:
sdk-ci:
name: SDK CI
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Upgrade npm to 11.10.0
run: npm install -g npm@11.10.0
- name: Create concatenated patch file
id: patch-file
run: |
ls -d -- packages/*/patches/*.patch 2>/dev/null | xargs cat > combined-patch-file.txt || touch combined-patch-file.txt
echo "patch_checksum=$(sha256sum combined-patch-file.txt | cut -d' ' -f1)" >> $GITHUB_OUTPUT
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: |
node_modules
packages/sdk/node_modules
key: npm-cache-sdk-${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}-${{ steps.patch-file.outputs.patch_checksum }}
restore-keys: |
npm-cache-sdk-${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}-
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
env:
CI: true
SKIP_POD_INSTALL: true
SKIP_ANDROID_INSTALL: true
ANDROID_HOME: /tmp/android-sdk-dummy
NODE_OPTIONS: --max-old-space-size=8192
run: npm ci --prefer-offline
- name: Cache for Turbo
uses: rharkor/caching-for-turbo@v2.2.1
- name: Lint
run: npx turbo run lint --filter=@audius/sdk
- name: Typecheck
run: npx turbo run typecheck --filter=@audius/sdk
- name: Run tests
timeout-minutes: 15
run: npx turbo run test --filter=@audius/sdk -- --reporter=default --reporter=junit --outputFile=report.xml
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: sdk-test-results
path: packages/sdk/report.xml